]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: Prevent a use-after-free on error scenario on option "-x".
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 17 Jul 2017 15:25:33 +0000 (17:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Jul 2017 02:22:32 +0000 (04:22 +0200)
This was introduced with recent commit f73629d ("MINOR: global: Add an
option to get the old listening sockets."). No backport is needed.

src/haproxy.c

index 23161007f184500ad716c9d2d1752175a8199ac3..7af1092d9396bf2a601ec78287dd0fa8bba92b1c 100644 (file)
@@ -997,6 +997,7 @@ static int get_old_sockets(const char *unixsocket)
                if (getsockname(fd, (struct sockaddr *)&xfer_sock->addr, &socklen) != 0) {
                        Warning("Failed to get socket address\n");
                        free(xfer_sock);
+                       xfer_sock = NULL;
                        continue;
                }
                if (curoff >= maxoff) {