]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lxc: use g_auto in lxcContainerChild
authorJán Tomko <jtomko@redhat.com>
Fri, 10 Dec 2021 17:33:06 +0000 (18:33 +0100)
committerJán Tomko <jtomko@redhat.com>
Mon, 13 Dec 2021 17:20:46 +0000 (18:20 +0100)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/lxc/lxc_container.c

index 1d5b9bf429ae2dd135d2ef108cf433a5bb693bd1..3f38c55fc69d5880addfd01b32d0a3d5b8ad4f41 100644 (file)
@@ -1927,7 +1927,7 @@ static int lxcContainerChild(void *data)
     int ret = -1;
     g_autofree char *ttyPath = NULL;
     virDomainFSDef *root;
-    virCommand *cmd = NULL;
+    g_autoptr(virCommand) cmd = NULL;
     int hasReboot;
     g_autofree gid_t *groups = NULL;
     int ngroups;
@@ -2075,7 +2075,6 @@ static int lxcContainerChild(void *data)
                 virGetLastErrorMessage());
     }
 
-    virCommandFree(cmd);
     return ret;
 }