]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix memory leak in virsh
authorHu Tao <hutao@cn.fujitsu.com>
Wed, 22 Dec 2010 07:12:34 +0000 (15:12 +0800)
committerEric Blake <eblake@redhat.com>
Wed, 22 Dec 2010 15:44:23 +0000 (08:44 -0700)
tools/virsh.c

index 4e37f2d8b0bbc19074d3b9a6647df2fc3c455771..8c123bb689e06ca8f79ca386c6f895425c34e52a 100644 (file)
@@ -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 */