From: Michal Privoznik Date: Thu, 21 Sep 2017 15:47:45 +0000 (+0200) Subject: nss: Don't leak @ipAddr X-Git-Tag: v3.8.0-rc1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1d87f9ad96f00a83107c90e0f2743811a9f7b79;p=thirdparty%2Flibvirt.git nss: Don't leak @ipAddr In aiforaf() (which exists only when building for BSD) the @ipAddr may be leaked. Signed-off-by: Michal Privoznik --- diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c index 9904026da0..da4bf79a46 100644 --- a/tools/nss/libvirt_nss.c +++ b/tools/nss/libvirt_nss.c @@ -643,6 +643,7 @@ aiforaf(const char *name, int af, struct addrinfo *pai, struct addrinfo **aip) hints.ai_family = af; if (getaddrinfo(ipAddr, NULL, &hints, &res0)) { + VIR_FREE(ipAaddr); addrList++; continue; } @@ -654,6 +655,7 @@ aiforaf(const char *name, int af, struct addrinfo *pai, struct addrinfo **aip) while ((*aip)->ai_next) *aip = (*aip)->ai_next; + VIR_FREE(ipAaddr); addrList++; } }