提交 3e4ce359 编写于 作者: J John Ferlan

qemu: Resolve Coverity FORWARD_NULL

Coverity complains over the [n]values pairing in virQEMUCapsFreeStringList
and rather than make a bunch if "if values" checks prior to calling, by
just adding the values check inside the free function we avoid the chance
that somehow nvalues is > 0, while values == NULL
上级 e7664eed
......@@ -1702,6 +1702,8 @@ virQEMUCapsFreeStringList(size_t len,
char **values)
{
size_t i;
if (!values)
return;
for (i = 0; i < len; i++)
VIR_FREE(values[i]);
VIR_FREE(values);
......@@ -1794,7 +1796,7 @@ virQEMUCapsParseDeviceStrObjectProps(const char *str,
ret = nproplist;
cleanup:
if (ret < 0 && proplist)
if (ret < 0)
virQEMUCapsFreeStringList(nproplist, proplist);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册