mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
conf: fix use after free
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
This commit is contained in:
parent
f38c7bb6ea
commit
679fcfe969
@ -1886,7 +1886,7 @@ virNetworkObjLoadAllPorts(virNetworkObjPtr net,
|
||||
}
|
||||
|
||||
while ((rc = virDirRead(dh, &de, dir)) > 0) {
|
||||
char *file = NULL;
|
||||
g_autofree char *file = NULL;
|
||||
|
||||
if (!virStringStripSuffix(de->d_name, ".xml"))
|
||||
continue;
|
||||
@ -1894,9 +1894,6 @@ virNetworkObjLoadAllPorts(virNetworkObjPtr net,
|
||||
file = g_strdup_printf("%s/%s.xml", dir, de->d_name);
|
||||
|
||||
portdef = virNetworkPortDefParseFile(file);
|
||||
VIR_FREE(file);
|
||||
file = NULL;
|
||||
|
||||
if (!portdef) {
|
||||
VIR_WARN("Cannot parse port %s", file);
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user