mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
interface: Fix resource leak in netcfConnectListAllInterfaces error path
On virGetInterface failure, call virInterfaceDefFree for the @def. (cherry picked from commit 1b1b045915bec4cbc6ed087c96be4b1de8953002)
This commit is contained in:
parent
dce5c95c28
commit
a7aacb742e
@ -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