From 6ca568e2ab2e4882ac126e813766b04421b55c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Mon, 26 Aug 2019 21:32:36 +0200 Subject: [PATCH] qemuBuildCommandLine: use VIR_RETURN_PTR for cmd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- src/qemu/qemu_command.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 31d3ef1bcd..85987a509e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10363,7 +10363,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, { size_t i; char uuid[VIR_UUID_STRING_BUFLEN]; - virCommandPtr cmd = NULL; + VIR_AUTOPTR(virCommand) cmd = NULL; VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver); unsigned int bootHostdevNet = 0; qemuDomainObjPrivatePtr priv = vm->privateData; @@ -10619,10 +10619,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, cfg->logTimestamp) virCommandAddArgList(cmd, "-msg", "timestamp=on", NULL); - return cmd; + VIR_RETURN_PTR(cmd); error: - virCommandFree(cmd); return NULL; }