]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nss: Don't leak @ipAddr
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Sep 2017 15:47:45 +0000 (17:47 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 22 Sep 2017 07:06:04 +0000 (09:06 +0200)
In aiforaf() (which exists only when building for BSD) the
@ipAddr may be leaked.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/nss/libvirt_nss.c

index 9904026da03cf9979d3725a9d4c99cea46fc9710..da4bf79a461756532ee6312c993bda7f6a3dba7b 100644 (file)
@@ -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++;
     }
 }