From bf15f10abe71dfa0e814185ca5217406b10601c2 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Thu, 4 Sep 2014 16:12:44 -0400 Subject: [PATCH] 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 --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index f5c3fadfca..30f9ffb9ae 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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; -- GitLab