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: Chris Lalancette <clalance@redhat.com>
This commit is contained in:
Chris Lalancette 2010-04-28 15:50:06 -04:00
parent 87d2e4ba56
commit 270895063d
1 changed files with 0 additions and 3 deletions

View File

@ -8081,9 +8081,6 @@ cmdEdit (vshControl *ctl, const vshCmd *cmd)
doc_edited = editReadBackFile (ctl, tmp);
if (!doc_edited) goto cleanup;
unlink (tmp);
tmp = NULL;
/* Compare original XML with edited. Has it changed at all? */
if (STREQ (doc, doc_edited)) {
vshPrint (ctl, _("Domain %s XML configuration not changed.\n"),