0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-01-05 00:21:54 +00:00

Fixed cold page cache leak

The empty_pages pointer wasn't being propagated into the ->next pointer
when more empty_pages were to be stored
This commit is contained in:
Maria Matejka 2023-05-03 18:59:52 +02:00
parent ed91d884d3
commit 1e998a4349

View File

@ -282,10 +282,13 @@ page_cleanup(void *_ UNUSED)
if (!empty_pages || (empty_pages->pos == EP_POS_MAX)) if (!empty_pages || (empty_pages->pos == EP_POS_MAX))
{ {
/* There is either no pointer block or the last block is full. We use this block as a pointer block. */ /* There is either no pointer block or the last block is full. We use this block as a pointer block. */
empty_pages = (struct empty_pages *) fp; struct empty_pages *ep = (struct empty_pages *) fp;
UNPROTECT_PAGE(empty_pages); UNPROTECT_PAGE(ep);
*empty_pages = (struct empty_pages) {}; *ep = (struct empty_pages) {
PROTECT_PAGE(empty_pages); .next = empty_pages,
};
PROTECT_PAGE(ep);
empty_pages = ep;
} }
else else
{ {