]> xenbits.xensource.com Git - libvirt.git/commitdiff
lxc: Use VIR_AUTOPTR for @veths in virLXCProcessStart
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 26 Jul 2018 15:33:01 +0000 (17:33 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 27 Jul 2018 15:07:23 +0000 (17:07 +0200)
Now that we have VIR_AUTOPTR and that @veths is a string list we
can use VIR_AUTOPTR to free it automagically.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/lxc/lxc_process.c

index ce9f903363305901b343a5b75eadb5f7d4a6341b..33c806630baf2ddd04442005c5808c0f7e3633a6 100644 (file)
@@ -1181,7 +1181,7 @@ int virLXCProcessStart(virConnectPtr conn,
     size_t i;
     char *logfile = NULL;
     int logfd = -1;
-    char **veths = NULL;
+    VIR_AUTOPTR(virString) veths = NULL;
     int handshakefds[2] = { -1, -1 };
     off_t pos = -1;
     char ebuf[1024];
@@ -1555,7 +1555,6 @@ int virLXCProcessStart(virConnectPtr conn,
         virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED);
     }
     virCommandFree(cmd);
-    virStringListFree(veths);
     for (i = 0; i < nttyFDs; i++)
         VIR_FORCE_CLOSE(ttyFDs[i]);
     VIR_FREE(ttyFDs);