mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
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;
|
hints.ai_family = af;
|
||||||
|
|
||||||
if (getaddrinfo(ipAddr, NULL, &hints, &res0)) {
|
if (getaddrinfo(ipAddr, NULL, &hints, &res0)) {
|
||||||
|
VIR_FREE(ipAaddr);
|
||||||
addrList++;
|
addrList++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -654,6 +655,7 @@ aiforaf(const char *name, int af, struct addrinfo *pai, struct addrinfo **aip)
|
|||||||
while ((*aip)->ai_next)
|
while ((*aip)->ai_next)
|
||||||
*aip = (*aip)->ai_next;
|
*aip = (*aip)->ai_next;
|
||||||
|
|
||||||
|
VIR_FREE(ipAaddr);
|
||||||
addrList++;
|
addrList++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user