提交 a7aacb74 编写于 作者: W Wang King 提交者: Cole Robinson

interface: Fix resource leak in netcfConnectListAllInterfaces error path

On virGetInterface failure, call virInterfaceDefFree for the @def.

(cherry picked from commit 1b1b0459)
上级 dce5c95c
......@@ -622,8 +622,10 @@ netcfConnectListAllInterfaces(virConnectPtr conn,
}
if (ifaces) {
if (!(iface_obj = virGetInterface(conn, def->name, def->mac)))
if (!(iface_obj = virGetInterface(conn, def->name, def->mac))) {
virInterfaceDefFree(def);
goto cleanup;
}
tmp_iface_objs[niface_objs] = iface_obj;
}
niface_objs++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册