[asterisk-dev] 0017234: [patch] Memory leak in manager.c - eqe should never be null!

Tilghman Lesher tlesher at digium.com
Mon Jun 7 14:01:39 CDT 2010


On Monday 07 June 2010 12:22:36 Dave Woolley wrote:
> I don't believe the latest fix to issues 0017234
> <https://issues.asterisk.org/view.php?id=17234> can have addressed the
> fundamental cause of the actual crash.  That's because it is defending
> against a condition that should be impossible.  session->last_ev is,
> currently, always set non-null before the session is added to the
> sessions list and should never be allowed to go null again once it is on
> that list.  The purge_sessions function, picks it from the sessions
> list, so should never receive a null last_ev pointer, so it looks to me
> that suppressing the use count decrement when it is null is simply
> papering over cracks.
>
> I can't work out how last_ev could get null.
>
> Unless I can understand why it gets null, I can't be sure that the same
> problem won't occur for TCP AMI, and if it can, know how to test that it
> is fixed for our usage.

I tend to agree with your assessment, though I also cannot argue with evidence
that it did, indeed, go NULL.  In fact, it appears that the event list was
going empty, and the initial grab_last() was returning NULL.

-- 
Tilghman



More information about the asterisk-dev mailing list