mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 12:13:33 +08:00
mmap-cache: LIST_REMOVE() *after* w->unused_prev
The LIST_REMOVE() macro always assigns NULL to w->unused_prev, meaning every time this window was in last_unused, the remainder of the unused list was lost to the ether. Turns out there's been a memory leak in journald after all, this code has been there since at least 2013...
This commit is contained in:
parent
f1da1e7b5f
commit
b82aca89a5
@ -224,9 +224,9 @@ static void context_attach_window(Context *c, Window *w) {
|
||||
|
||||
if (w->in_unused) {
|
||||
/* Used again? */
|
||||
LIST_REMOVE(unused, c->cache->unused, w);
|
||||
if (c->cache->last_unused == w)
|
||||
c->cache->last_unused = w->unused_prev;
|
||||
LIST_REMOVE(unused, c->cache->unused, w);
|
||||
|
||||
w->in_unused = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user