提交 7e208625 编写于 作者: Z ZhiPeng Lu 提交者: John Ferlan

nwfilter: Fix memory leak in virNWFilterIPAddrMapAddIPAddr

If virNWFilterHashTablePut fails, then the @val was leaked.
Signed-off-by: NZhiPeng Lu <lu.zhipeng@zte.com.cn>
上级 955caf17
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册