mirror of https://gitee.com/openkylin/libvirt.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 <mprivozn@redhat.com>
This commit is contained in:
parent
ffdce9b1f1
commit
b1d87f9ad9
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue