mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
nwfilter: Fix memory leak in virNWFilterIPAddrMapAddIPAddr
If virNWFilterHashTablePut fails, then the @val was leaked. Signed-off-by: ZhiPeng Lu <lu.zhipeng@zte.com.cn>
This commit is contained in:
parent
955caf171c
commit
7e20862576
@ -61,6 +61,8 @@ virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr)
|
||||
if (!val)
|
||||
goto cleanup;
|
||||
ret = virNWFilterHashTablePut(ipAddressMap, ifname, val);
|
||||
if (ret < 0)
|
||||
virNWFilterVarValueFree(val);
|
||||
goto cleanup;
|
||||
} else {
|
||||
if (virNWFilterVarValueAddValue(val, addr) < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user