qemu: Resolve Coverity FORWARD_NULL

If the virJSONValueNewObject() fails, then rather than going to error
and getting a Coverity false positive since it doesn't seem to understand
the relationship between nkeywords, keywords, and values and seems to
believe calling qemuFreeKeywords will cause a NULL deref - just return NULL

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2014-09-04 16:12:44 -04:00
parent 60b029c7a0
commit bf15f10abe
1 changed files with 1 additions and 1 deletions

View File

@ -639,7 +639,7 @@ qemuMonitorJSONKeywordStringToJSON(const char *str, const char *firstkeyword)
size_t i;
if (!(ret = virJSONValueNewObject()))
goto error;
return NULL;
if (qemuParseKeywords(str, &keywords, &values, &nkeywords, 1) < 0)
goto error;