]> git.ipfire.org Git - thirdparty/systemd.git/commit
hashmap: honor the value destructor in set_ensure_consume()
authorLuca Boccassi <luca.boccassi@gmail.com>
Thu, 2 Jul 2026 17:02:10 +0000 (18:02 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 6 Jul 2026 12:42:21 +0000 (13:42 +0100)
commit87e57c52c16030e73ea323578034cd5b67e60da2
tree3aa711e497037f10aa5f540f4ad485412b4cefbd
parent2f72db10d9a0cdf3c1b22044df44c2e9fd61ff1b
hashmap: honor the value destructor in set_ensure_consume()

Sets store their element in the key slot but use a value destructor
(DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR). On the reject/duplicate path
set_ensure_consume() only checked free_key and otherwise called free().

Follow-up for fcc1d0315d335ba31d85d6023c79d6404c62e167
src/basic/hashmap.c
src/test/test-set.c