In learnIPAddressThread()the @inetaddr may be leaked.
Signed-off-by: ZhiPeng Lu <lu.zhipeng(a)zte.com.cn>
---
src/nwfilter/nwfilter_learnipaddr.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index cfd92d9..5dc212e 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -625,6 +625,7 @@ learnIPAddressThread(void *arg)
if (virNWFilterIPAddrMapAddIPAddr(req->ifname, inetaddr) < 0) {
VIR_ERROR(_("Failed to add IP address %s to IP address "
"cache for interface %s"), inetaddr,
req->ifname);
+ VIR_FREE(inetaddr);
}
ret = virNWFilterInstantiateFilterLate(req->driver,
@@ -636,7 +637,8 @@ learnIPAddressThread(void *arg)
req->filtername,
req->filterparams);
VIR_DEBUG("Result from applying firewall rules on "
- "%s with IP addr %s : %d", req->ifname, inetaddr,
ret);
+ "%s with IP addr %s : %d", req->ifname,
NULLSTR(inetaddr), ret);
+
}
} else {
if (showError)
--
1.8.3.1