提交 27089506 编写于 作者: C Chris Lalancette

Fix a virsh edit memory leak

When running virsh edit, we are unlinking and setting
the tmp variable to NULL before going to the end of the
function, meaning that we never free tmp.  Since the
exit to the function will always unlink and free tmp,
just remove this bit of code and let it get done at the
end.
Signed-off-by: NChris Lalancette <clalance@redhat.com>
上级 87d2e4ba
...@@ -8081,9 +8081,6 @@ cmdEdit (vshControl *ctl, const vshCmd *cmd) ...@@ -8081,9 +8081,6 @@ cmdEdit (vshControl *ctl, const vshCmd *cmd)
doc_edited = editReadBackFile (ctl, tmp); doc_edited = editReadBackFile (ctl, tmp);
if (!doc_edited) goto cleanup; if (!doc_edited) goto cleanup;
unlink (tmp);
tmp = NULL;
/* Compare original XML with edited. Has it changed at all? */ /* Compare original XML with edited. Has it changed at all? */
if (STREQ (doc, doc_edited)) { if (STREQ (doc, doc_edited)) {
vshPrint (ctl, _("Domain %s XML configuration not changed.\n"), vshPrint (ctl, _("Domain %s XML configuration not changed.\n"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册