mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-29 12:01:16 +00:00
interface: Fix resource leak in netcfConnectListAllInterfaces error path
On virGetInterface failure, call virInterfaceDefFree for the @def.
This commit is contained in:
parent
b1aa4613a7
commit
1b1b045915
@ -622,8 +622,10 @@ netcfConnectListAllInterfaces(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ifaces) {
|
if (ifaces) {
|
||||||
if (!(iface_obj = virGetInterface(conn, def->name, def->mac)))
|
if (!(iface_obj = virGetInterface(conn, def->name, def->mac))) {
|
||||||
|
virInterfaceDefFree(def);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
tmp_iface_objs[niface_objs] = iface_obj;
|
tmp_iface_objs[niface_objs] = iface_obj;
|
||||||
}
|
}
|
||||||
niface_objs++;
|
niface_objs++;
|
||||||
|
Loading…
Reference in New Issue
Block a user