diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a872598965997f7803941b1f3bbff7a22dc175ae..d60cf73a2915a8412ca4ab62b6123808b9eddc2e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2360,13 +2360,15 @@ qemuDomainLogContextPtr qemuDomainLogContextNew(virQEMUDriverPtr driver, } } + cleanup: virObjectUnref(cfg); + VIR_FREE(logfile); return ctxt; error: - virObjectUnref(cfg); qemuDomainLogContextFree(ctxt); - return NULL; + ctxt = NULL; + goto cleanup; }