mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
util: Use glib memory functions in virJSONValueGetArrayAsBitmap
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
1fb2a560c3
commit
f323da47ec
@ -1243,8 +1243,7 @@ virJSONValueGetArrayAsBitmap(const virJSONValue *val,
|
||||
if (val->type != VIR_JSON_TYPE_ARRAY)
|
||||
return -1;
|
||||
|
||||
if (VIR_ALLOC_N_QUIET(elems, val->data.array.nvalues) < 0)
|
||||
return -1;
|
||||
elems = g_new0(unsigned long long, val->data.array.nvalues);
|
||||
|
||||
/* first pass converts array members to numbers and finds the maximum */
|
||||
for (i = 0; i < val->data.array.nvalues; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user