hashmap: avoid using TLS in a destructor
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 18 Jun 2019 09:25:16 +0000 (11:25 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Jun 2019 11:59:12 +0000 (13:59 +0200)
commit31c9d74d500b6fad86f1ec26ab5bba156051e813
tree6a882ed18ffd784903d55339c046acf1701717e2
parent59da64738b69dad1ac9f3bb93a99ac695f0d41d4
hashmap: avoid using TLS in a destructor

Using C11 thread-local storage in destructors causes uninitialized
read. Let's avoid that using a direct comparison instead of using
the cached values. As this code path is taken only when compiled
with -DVALGRIND=1, the performance cost shouldn't matter too much.

Fixes #12814
src/basic/hashmap.c