mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-06-16 02:35:58 +00:00
journal: fix hashmap leak in mmap-cache
hashmap_free() wasn't being called on m->contexts and m->fds resulting
in a leak.
To reproduce do:
while(1) {
sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
sd_journal_close(j);
}
Memory usage will increase until OOM.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
85abe611e7
commit
81be5f2e03
@@ -308,9 +308,13 @@ static void mmap_cache_free(MMapCache *m) {
|
||||
while ((c = hashmap_first(m->contexts)))
|
||||
context_free(c);
|
||||
|
||||
hashmap_free(m->contexts);
|
||||
|
||||
while ((f = hashmap_first(m->fds)))
|
||||
fd_free(f);
|
||||
|
||||
hashmap_free(m->fds);
|
||||
|
||||
while (m->unused)
|
||||
window_free(m->unused);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user