From d3fc257245e579747b3f634fb9559c792f545979 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 14 Nov 2016 16:56:08 -0500 Subject: [PATCH] gssmask: client_connect addrinfo leak In client_connect() getaddrinfo() stores the head of the allocated addrinfo structure list in 'res0'. 'res' is used to walk the list and will be NULL at the end of the for() loop when freeaddrinfo(res) is executed. Pass 'res0' to freeaddrinfo() instead of 'res'. Change-Id: Ie1358c0356b6b0f98470e46e25216cfa0ab4adac --- appl/gssmask/gssmaestro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appl/gssmask/gssmaestro.c b/appl/gssmask/gssmaestro.c index c3a850f1f..5df1c8669 100644 --- a/appl/gssmask/gssmaestro.c +++ b/appl/gssmask/gssmaestro.c @@ -646,7 +646,7 @@ connect_client(const char *slave) } if (sock == rk_INVALID_SOCKET) err(1, "connect to host: %s", name); - freeaddrinfo(res); + freeaddrinfo(res0); c->sock = krb5_storage_from_socket(sock); rk_closesocket(sock);