[libvirt] [PATCH] Fix a virsh edit memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tools/virsh.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 04b47a1..ab099da 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -8066,9 +8066,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"),
-- 
1.6.6.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]