From 270895063d1cf86ab42fa220a8d090c24d58dbc0 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 28 Apr 2010 15:50:06 -0400 Subject: [PATCH] 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 --- tools/virsh.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 5bcf0ede9a..a1ad637f61 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -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"), -- GitLab