The virJSONValueObjectGetStringArray() function is given a @key
which is supposed to be an array inside given @object. Well, if
it's not then an error state is returned (NULL), but no error
message is set.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
size_t i;
data = virJSONValueObjectGetArray(object, key);
- if (!data)
+ if (!data) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("%s is missing or not an array"),
+ key);
return NULL;
+ }
n = virJSONValueArraySize(data);
ret = g_new0(char *, n + 1);