util: json: check return value of virJSONValueFromJsonC

In virJSONValueFromJsonC, the return value of virJSONValueFromJsonC
was not checked in one case.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Ján Tomko 2024-11-06 13:19:29 +01:00
parent 13f40898ab
commit da66bf53b0

View File

@ -1437,6 +1437,11 @@ virJSONValueFromJsonC(json_object *jobj)
cur = virJSONValueFromJsonC(val);
if (!cur) {
g_free(ret);
return NULL;
}
virJSONValueArrayAppend(ret, &cur);
}
break;