From 81f48395b325b9875d215ec2743e75f7a56e1e5f Mon Sep 17 00:00:00 2001 From: Valentine Krasnobaeva Date: Wed, 7 Aug 2024 19:34:07 +0200 Subject: [PATCH] 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. --- src/proto_tcp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 25d66bafd..e245a38c4 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) {