<div class="gmail_quote">On Fri, May 22, 2009 at 11:09 AM, Holger Wirtz <span dir="ltr"><<a href="mailto:wirtz@dfn.de">wirtz@dfn.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> 1. free() does *NOT* set the ptr to NULL. It just marks the allocated<br>
<div class="im">> memory as unused. The ptr will still keep pointing to the same address. Its<br>
> the programmer's responsibility to ensure that ptr is not used again in this<br>
> state.<br>
<br>
</div>Yes. That's why I think tehere is a problem with a freed pointer that<br>
isn't set to NULL...<br>
</blockquote></div><br>So you should set your pointer to NULL after freeing it. This way you will never free the same pointer twice.<br>