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 (Line 95, evt.c):

   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);
        }