1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

conf: virsecretobj: fix g_new0 allocation

Fixes commit <d5b05614dfbc9bd60ea1a31a9cc32aaf3c771ddc> which changed
allocation from VIR_ALLOC_N to g_new0 but missed one +1 on number of
allocated elements.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Pavel Hrdina 2020-10-12 19:54:36 +02:00
parent 8a666dccda
commit 71a6522e4f

View File

@ -588,7 +588,7 @@ virSecretObjListExport(virConnectPtr conn,
virObjectRWLockRead(secretobjs);
if (secrets)
data.secrets = g_new0(virSecretPtr, virHashSize(secretobjs->objs));
data.secrets = g_new0(virSecretPtr, virHashSize(secretobjs->objs) + 1);
virHashForEach(secretobjs->objs, virSecretObjListExportCallback, &data);
virObjectRWUnlock(secretobjs);