Signed-off-by: Ryan Moeller <ryan(a)iXsystems.com>
---
src/conf/virnetworkobj.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c
index 299cdba52d..b2affaacd3 100644
--- a/src/conf/virnetworkobj.c
+++ b/src/conf/virnetworkobj.c
@@ -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;
--
2.24.1