mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-04 05:15:46 +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
|
static int
|
||||||
vzDoCmdRun(char **outbuf, const char *binary, va_list list)
|
vzDoCmdRun(char **outbuf, const char *binary, va_list list)
|
||||||
{
|
{
|
||||||
virCommand *cmd = virCommandNewVAList(binary, list);
|
g_autoptr(virCommand) cmd = virCommandNewVAList(binary, list);
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (outbuf)
|
if (outbuf)
|
||||||
@ -104,7 +104,6 @@ vzDoCmdRun(char **outbuf, const char *binary, va_list list)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
|
||||||
if (ret && outbuf)
|
if (ret && outbuf)
|
||||||
VIR_FREE(*outbuf);
|
VIR_FREE(*outbuf);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user