提交 7c5735dc 编写于 作者: J Jim Meyering

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.
上级 7ac27870
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册