From 7c5735dc2a59cd6d5576daa272d6de31206390f9 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 16 Feb 2010 14:34:48 +0100 Subject: [PATCH] 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. --- tools/virsh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;