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

tests: Coverity found new NULL_RETURNS

Coverity reported the existing missing check of the return value and
subsequent use from a call to virJSONValueFromString() in testJSONAddRemove().
上级 a320730a
......@@ -60,11 +60,17 @@ testJSONAddRemove(const void *data)
{
const struct testInfo *info = data;
virJSONValuePtr json;
virJSONValuePtr name;
virJSONValuePtr name = NULL;
char *result = NULL;
int ret = -1;
json = virJSONValueFromString(info->doc);
if (!json) {
if (virTestGetVerbose())
fprintf(stderr, "Fail to parse %s\n", info->doc);
ret = -1;
goto cleanup;
}
switch (virJSONValueObjectRemoveKey(json, "name", &name)) {
case 1:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册