mirror of https://gitee.com/openkylin/libvirt.git
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…
Reference in New Issue