Re: double free

From: Alan Balmer (albalmer_at_att.net)
Date: 07/01/04


Date: Thu, 01 Jul 2004 11:52:07 -0700

On 1 Jul 2004 11:27:36 -0700, weaselboy1976@yahoo.com (weaselboy1976)
wrote:

>Hello
>
>Does anyone know of a good website that actually describes and
>demonstrates WHY freeing a pointer more than once is a problem. I'm
>specifically interested in what the ill effects are.

You probably won't find such a site, because the effects are
implementation dependent. On at least some implementations, it can
corrupt the heap.
>
>Also, if you know of any really good books that describe everything
>about memory in a c program ...
>
Same problem - dependent on architecture and runtime implementation.

>Thanks in advance!

Obviously the proper way to handle freeing a pointer more than once is
"Don't do it!" If you have a reason to know the effects on a
particular implementation, you need to find a newsgroup or other
source of information which deals with that particular implementation,
because it will be off-topic here.

-- 
Al Balmer
Balmer Consulting
removebalmerconsultingthis@att.net


Relevant Pages

  • Re: double free
    ... > Does anyone know of a good website that actually describes and ... > demonstrates WHY freeing a pointer more than once is a problem. ... of memory. ...
    (comp.lang.c)
  • double free
    ... Does anyone know of a good website that actually describes and ... demonstrates WHY freeing a pointer more than once is a problem. ... about memory in a c program ... ...
    (comp.lang.c)
  • Re: double free
    ... > Does anyone know of a good website that actually describes and ... > demonstrates WHY freeing a pointer more than once is a problem. ... if you thereafter allocate memory for p then the code should looks like: ...
    (comp.lang.c)
  • Re: double free
    ... > Does anyone know of a good website that actually describes and ... > demonstrates WHY freeing a pointer more than once is a problem. ... to freeagain, invokes undefined behavior, with arbitrarily bad ...
    (comp.lang.c)
  • Re: free()
    ... freeing a goat will have to deal with this. ... going to give it a new value, so no point nulling it. ... rather than nulling the pointer because you're freeing it ...
    (comp.lang.c)