mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00: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:
parent
cce545ddb6
commit
520f5752be
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user