nss: Don't leak @ipAddr

In aiforaf() (which exists only when building for BSD) the
@ipAddr may be leaked.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2017-09-21 17:47:45 +02:00
parent ffdce9b1f1
commit b1d87f9ad9
1 changed files with 2 additions and 0 deletions

View 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++;
}
}