HomeClusterLabs Projects

stats: fix crash when iterating over deleted keys

Description

stats: fix crash when iterating over deleted keys

The libqb map API leaves 'ownership' of the data with the caller
but does its own lifetime management, so it can easily happen that
map_rm() is called and the data deleted by the caller.
But if an iterator is running over that item then the map entry
will not get removed (leaving dangling pointers) until later.

libqb has a hack-y callback that tells the owner when it is safe to
delete the allocated memory, so we hook into that. icmap is already
using this.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>

Details

Provenance
chrissie-cAuthored on Jun 3 2021, 2:53 AM
jfriesseCommitted on Jun 3 2021, 4:14 AM
Parents
rC7ff95c767ead: man: Add note about single node configuration
Branches
Unknown
Tags
Unknown
References
tag: v3.1.4

Event Timeline