From: Hu Tao Date: Wed, 22 Dec 2010 07:12:34 +0000 (+0800) Subject: Fix memory leak in virsh X-Git-Tag: v0.8.7~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29f92d64d3d56ade58fce39500e062da4df3406e;p=thirdparty%2Flibvirt.git Fix memory leak in virsh --- diff --git a/tools/virsh.c b/tools/virsh.c index 4e37f2d8b0..8c123bb689 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 */