[libvirt PATCH 08/14] lxc: use g_auto in lxcContainerChild

Ján Tomko jtomko at redhat.com
Mon Dec 13 13:59:37 UTC 2021


Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/lxc/lxc_container.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 1d5b9bf429..3f38c55fc6 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -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;
 }
 
-- 
2.31.1




More information about the libvir-list mailing list