diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 31d3ef1bcd91305726ef813de5107be53bcf9375..85987a509ed9c5e1a9418b7142f77d20f7fa5ad3 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; }