[PATCH] Fix memory leak in virsh

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

 



---
 tools/virsh.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 4e37f2d..8c123bb 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -10935,8 +10935,10 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser)
 
             if (tk == VSH_TK_ERROR)
                 goto syntaxError;
-            if (tk != VSH_TK_ARG)
+            if (tk != VSH_TK_ARG) {
+                VIR_FREE(tkdata);
                 break;
+            }
 
             if (cmd == NULL) {
                 /* first token must be command name */
-- 
1.7.3.1


-- 
Thanks,
Hu Tao

--
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]