]> git.ipfire.org Git - thirdparty/libvirt.git/commit
locking: sanlock: Avoid use of VIR_ALLOC_VAR for 'struct sanlk_resource'
authorPeter Krempa <pkrempa@redhat.com>
Wed, 3 Feb 2021 12:31:15 +0000 (13:31 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 3 Feb 2021 15:09:25 +0000 (16:09 +0100)
commit729ac1393828c8fa1dfe27df9a71cf0b4e8179f1
tree4ab80f0b934cb5c25966ef5ea079c093e2d2d6ff
parent7d836cfba1f5dd8c1a1fb5760f6a73db02fc9d15
locking: sanlock: Avoid use of VIR_ALLOC_VAR for 'struct sanlk_resource'

In both cases we need memory for a 'struct sanlk_resource' followed by
one 'struct sanlk_disk', thus there's no risk of overflow.

Use g_malloc0 and sizeof() to allocate the memory instead of
VIR_ALLOC_VAR.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/locking/lock_driver_sanlock.c