mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
vz: utils: use g_auto for virCommand
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
4a56179646
commit
975a2b3555
@ -92,7 +92,7 @@ vzDomObjFromDomain(virDomainPtr domain)
|
||||
static int
|
||||
vzDoCmdRun(char **outbuf, const char *binary, va_list list)
|
||||
{
|
||||
virCommand *cmd = virCommandNewVAList(binary, list);
|
||||
g_autoptr(virCommand) cmd = virCommandNewVAList(binary, list);
|
||||
int ret = -1;
|
||||
|
||||
if (outbuf)
|
||||
@ -104,7 +104,6 @@ vzDoCmdRun(char **outbuf, const char *binary, va_list list)
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
if (ret && outbuf)
|
||||
VIR_FREE(*outbuf);
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user