#36 memory leak in event quque management

0.6 branch
closed-fixed
Timo Teras
None
5
2009-01-09
2005-09-26
Anonymous
No

From: Jianli Liu
Email: jlliu@nortel.com

When racoon is built with the option "--enable-
adminport", racoon pushes events such as "phase 1
deleted" into an event queue, by calling the
function "evt_push()" in evt.c. The events in the queue
are purged when a user issues a racoonctl show-event
command. However, if the user does not issue such a
racoonctl command, the events in the queue will never
go away and the queue will become longer and longer. It
causes racoon's memory usage keeps growing.

Here is how we fix the problem:

Old code:

if (evtlist_len++ == EVTLIST_MAX)
evt_push(NULL, NULL, EVTT_OVERFLOW, NULL);

New code:

if (evtlist_len++ == EVTLIST_MAX)
{
evtdump = evt_pop();
if (evtdump != NULL)
free(evtdump);
}

Discussion

  • Timo Teras
    Timo Teras
    2009-01-09

    • assigned_to: nobody --> fabled80
    • status: open --> closed-fixed