]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nss: Don't leak @addr in gethostbyname4()
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 28 Sep 2019 18:42:29 +0000 (20:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 30 Sep 2019 10:27:22 +0000 (12:27 +0200)
Similarly to gethostbyname3(), the @addr must be freed on return
from the function.

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

index 8fe5a6d1cf8d8713ffa5ff8e88c9675a46166ad6..6e332f75784719fd3343e5399c433b62d80f4053 100644 (file)
@@ -451,6 +451,7 @@ NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat,
     *herrnop = NETDB_SUCCESS;
     ret = NSS_STATUS_SUCCESS;
  cleanup:
+    free(addr);
     return ret;
 }
 #endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */