From: Jim Meyering Date: Tue, 16 Feb 2010 13:34:48 +0000 (+0100) Subject: vshCommandParse: placate coverity X-Git-Tag: v0.7.7~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c5735dc2a59cd6d5576daa272d6de31206390f9;p=thirdparty%2Flibvirt.git vshCommandParse: placate coverity There is no real leak here, but Coverity-Prevent thinks there is. It does not see that while there are four ways to return from vshCommandGetToken with VSH_TK_END, none of them results in allocation of a result. * tools/virsh.c (vshCommandParse): Add a (currently) useless VIR_FREE, to ensure that we never leak when vshCommandGetToken returns VSH_TK_END. --- diff --git a/tools/virsh.c b/tools/virsh.c index 7db48d972a..4ffa154dc7 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -8222,8 +8222,10 @@ vshCommandParse(vshControl *ctl, char *cmdstr) str = end; - if (tk == VSH_TK_END) + if (tk == VSH_TK_END) { + VIR_FREE(tkdata); break; + } if (tk == VSH_TK_ERROR) goto syntaxError;