lxc: use g_auto in lxcContainerChild

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko 2021-12-10 18:33:06 +01:00
parent ee6b552aab
commit fe9d5d6d00

View File

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