From: Valentine Krasnobaeva Date: Wed, 7 Aug 2024 17:34:07 +0000 (+0200) Subject: BUG/MINOR: proto_tcp: keep error msg if listen() fails X-Git-Tag: v3.1-dev6~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81f48395b325b9875d215ec2743e75f7a56e1e5f;p=thirdparty%2Fhaproxy.git BUG/MINOR: proto_tcp: keep error msg if listen() fails If listen() fails, we need to keep the message about it, which is copied then in errmsg buffer on the error path. This buffer is properly provided by the caller (protocol_bind_all()) and reallocated if needed in memprintf(), but it was deleted without being returned. This can be backported to all stable versions. --- diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 25d66bafdd..e245a38c4f 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -692,8 +692,6 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen) goto tcp_return; tcp_close_return: - free_trash_chunk(msg); - msg = NULL; fd_delete(fd); tcp_return: if (msg && errlen && msg->data) {