提交 0eafe995 编写于 作者: D Daniel P. Berrange

qemu: fix memory leak in opening log file

The qemuDomainLogContextNew method leaks the "logfile" path
on the non-virtlogd code path.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 2b8d0d44
...@@ -2360,13 +2360,15 @@ qemuDomainLogContextPtr qemuDomainLogContextNew(virQEMUDriverPtr driver, ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册