mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virJSONValueNewArray: Use g_new0 to allocate and remove NULL checks from callers
Use the glib allocation function that never returns NULL and remove the now dead-code checks from all callers. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
@@ -737,8 +737,7 @@ testQemuCheckpointDeleteMerge(const void *opaque)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(actions = virJSONValueNewArray()))
|
||||
return -1;
|
||||
actions = virJSONValueNewArray();
|
||||
|
||||
if (qemuCheckpointDiscardDiskBitmaps(data->chain,
|
||||
nodedata,
|
||||
|
||||
@@ -2948,9 +2948,8 @@ testQemuMonitorJSONTransaction(const void *opaque)
|
||||
if (!(test = qemuMonitorTestNewSchema(data->xmlopt, data->schema)))
|
||||
return -1;
|
||||
|
||||
if (!(actions = virJSONValueNewArray()) ||
|
||||
!(mergebitmaps = virJSONValueNewArray()))
|
||||
return -1;
|
||||
actions = virJSONValueNewArray();
|
||||
mergebitmaps = virJSONValueNewArray();
|
||||
|
||||
if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(mergebitmaps, "node1", "bitmap1") < 0 ||
|
||||
qemuMonitorTransactionBitmapMergeSourceAddBitmap(mergebitmaps, "node2", "bitmap2") < 0)
|
||||
|
||||
Reference in New Issue
Block a user