qemu: fix memory leak in opening log file

The qemuDomainLogContextNew method leaks the "logfile" path
on the non-virtlogd code path.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2015-12-03 17:24:10 +00:00
parent 2b8d0d44b9
commit 0eafe9955b

View File

@ -2360,13 +2360,15 @@ qemuDomainLogContextPtr qemuDomainLogContextNew(virQEMUDriverPtr driver,
} }
} }
cleanup:
virObjectUnref(cfg); virObjectUnref(cfg);
VIR_FREE(logfile);
return ctxt; return ctxt;
error: error:
virObjectUnref(cfg);
qemuDomainLogContextFree(ctxt); qemuDomainLogContextFree(ctxt);
return NULL; ctxt = NULL;
goto cleanup;
} }