From b1d87f9ad96f00a83107c90e0f2743811a9f7b79 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 21 Sep 2017 17:47:45 +0200 Subject: [PATCH] nss: Don't leak @ipAddr In aiforaf() (which exists only when building for BSD) the @ipAddr may be leaked. Signed-off-by: Michal Privoznik --- tools/nss/libvirt_nss.c | 2 ++ 1 file changed, 2 insertions(+) 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++; } }