mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: fix NULL deref when exporting ports
Reviewed-by: John Ferlan <jferlan@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
@@ -1810,10 +1810,12 @@ virNetworkObjPortListExport(virNetworkPtr net,
|
||||
};
|
||||
int ret = -1;
|
||||
|
||||
*ports = NULL;
|
||||
if (ports) {
|
||||
*ports = NULL;
|
||||
|
||||
if (ports && VIR_ALLOC_N(data.ports, virHashSize(obj->ports) + 1) < 0)
|
||||
goto cleanup;
|
||||
if (VIR_ALLOC_N(data.ports, virHashSize(obj->ports) + 1) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
virHashForEach(obj->ports, virNetworkObjPortListExportCallback, &data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user