In virJSONValueFromJsonC, the return value of virJSONValueFromJsonC
was not checked in one case.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/util/virjson.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/util/virjson.c b/src/util/virjson.c
index 18a4585e7b..a799707c16 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -1437,6 +1437,11 @@ virJSONValueFromJsonC(json_object *jobj)
cur = virJSONValueFromJsonC(val);
+ if (!cur) {
+ g_free(ret);
+ return NULL;
+ }
+
virJSONValueArrayAppend(ret, &cur);
}
break;
--
2.47.0