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:
parent
8a666dccda
commit
71a6522e4f
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user