[asterisk-dev] How to find crashing problems (cause maybe double free) in my own module?
Håkon Nessjøen
haakon at avelia.no
Tue Sep 8 09:10:23 CDT 2009
On Fri, May 22, 2009 at 11:09 AM, Holger Wirtz <wirtz at dfn.de> wrote:
> > 1. free() does *NOT* set the ptr to NULL. It just marks the allocated
> > memory as unused. The ptr will still keep pointing to the same
> address. Its
> > the programmer's responsibility to ensure that ptr is not used again
> in this
> > state.
>
> Yes. That's why I think tehere is a problem with a freed pointer that
> isn't set to NULL...
>
So you should set your pointer to NULL after freeing it. This way you will
never free the same pointer twice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20090908/b281e794/attachment.htm
More information about the asterisk-dev
mailing list