Re: Error freeing memory....
- From: pete <pfiland@xxxxxxxxxxxxxx>
- Date: Mon, 15 Mar 2010 08:09:15 -0500
Nick Keighley wrote:
On 15 Mar, 02:33, pete <pfil...@xxxxxxxxxxxxxx> wrote:
Eric Sosman wrote:
On 3/14/2010 1:57 PM, Sheldon wrote:
I have a fairly large program that has a problem that I cannot seem to
solve.
The program runs smoothly but when it tries to free allocated memory
before exiting I get a segmentation fault.
I have checked many times the following:
1. That I have not freed the memory before hand and call free this
way: if(array) free(array);
A note in passing: This makes no difference, because
free(NULL) is legal (and does nothing).
And it also makes no difference because
if(freed_pointer) free(freed_pointer);
is still undefined.
why?
I intended for (freed_pointer) to represent a previously freed pointer.
--
pete
.
- Follow-Ups:
- Re: Error freeing memory....
- From: Nick Keighley
- Re: Error freeing memory....
- References:
- Error freeing memory....
- From: Sheldon
- Re: Error freeing memory....
- From: Eric Sosman
- Re: Error freeing memory....
- From: pete
- Re: Error freeing memory....
- From: Nick Keighley
- Error freeing memory....
- Prev by Date: Re: Error freeing memory....
- Next by Date: Re: Initializing a character array with a string literal?
- Previous by thread: Re: Error freeing memory....
- Next by thread: Re: Error freeing memory....
- Index(es):
Relevant Pages
|