mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +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 (!(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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user