BUG/MINOR: Prevent a use-after-free on error scenario on option "-x".

This was introduced with recent commit f73629d ("MINOR: global: Add an
option to get the old listening sockets."). No backport is needed.
This commit is contained in:
Olivier Houchard 2017-07-17 17:25:33 +02:00 committed by Willy Tarreau
parent 106f631280
commit be7b1ce4c1

View File

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