[systemd-devel] Leak mempool/hashmap

Lennart Poettering lennart at poettering.net
Thu Nov 6 10:05:18 PST 2014


On Thu, 06.11.14 18:36, Jan Janssen (medhefgo at web.de) wrote:

> Hi,
> 
> I just noticed that mempool/hashmap leaks memory. It's as simple as this to
> trigger:
> 
> #include "hashmap.h"
> int main(int argc, const char *argv[]) {
>         Hashmap *m = hashmap_new(&string_hash_ops);
>         hashmap_free(m);
> }

How did you determine the leak?

Note that the hashmap uses an allocation cache. It's not freed on
shutdown, but it's not leaked either...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list