Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > free(): invalid pointer

Reply
Thread Tools

free(): invalid pointer

 
 
c language
Guest
Posts: n/a
 
      06-14-2006
Hi All,

I have written a C++ program, it can be compiled (in UNIX) but when I
run it, I usually gives the following errors:

free(): invalid pointer 0x51d4a0!
free(): invalid pointer 0x51d460!
free(): invalid pointer 0x51d760!
free(): invalid pointer 0x51d7e0!
..
..
..

Can anyone help me to know what is the reason for this problem?

Thanks,

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      06-14-2006
c language wrote:
> Hi All,
>
> I have written a C++ program,


Then you should go down the hall to the C++ group.

> it can be compiled (in UNIX) but when I
> run it, I usually gives the following errors:
>
> free(): invalid pointer 0x51d4a0!
> free(): invalid pointer 0x51d460!
> free(): invalid pointer 0x51d760!
> free(): invalid pointer 0x51d7e0!
> ..
> ..
> ..
>
> Can anyone help me to know what is the reason for this problem?
>

Passing an invalid pointer to free? When you post on the C++ group,
include the code.

--
Ian Collins.
 
Reply With Quote
 
 
 
 
Robert Gamble
Guest
Posts: n/a
 
      06-14-2006
c language wrote:
> Hi All,
>
> I have written a C++ program, it can be compiled (in UNIX) but when I
> run it, I usually gives the following errors:
>
> free(): invalid pointer 0x51d4a0!
> free(): invalid pointer 0x51d460!
> free(): invalid pointer 0x51d760!
> free(): invalid pointer 0x51d7e0!
>
> Can anyone help me to know what is the reason for this problem?


Why don't you try posting your question, along with a small, complete,
compilable example that demonstrates your issue, to comp.lang.c++. It
is very difficult to know exactly what the problem is without seeing
your code although, and I am going out on a limb here, you may be
trying to free an invalid pointer (i.e. a pointer that was not returned
to you by malloc and friends).

Robert Gamble

 
Reply With Quote
 
seni.yin
Guest
Posts: n/a
 
      06-14-2006

make sure the memory your pointer point to is allocated by fuction
"malloc"!

 
Reply With Quote
 
Michael Mair
Guest
Posts: n/a
 
      06-14-2006
seni.yin schrieb:
> make sure the memory your pointer point to is allocated by fuction
> "malloc"!


What are you responding to? Please quote sufficient context.
The above may be right or wrong, depending on the context.

Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pointer to pointer or reference to pointer A C++ 7 07-05-2011 07:49 PM
Pointer to pointer Vs References to Pointer bansalvikrant@gmail.com C++ 4 07-02-2009 10:20 AM
passing the address of a pointer to a func that doesnt recieve a pointer-to-a-pointer jimjim C Programming 16 03-27-2006 11:03 PM
Pointer-to-pointer-to-pointer question masood.iqbal@lycos.com C Programming 10 02-04-2005 02:57 AM
pointer-to-pointer (invalid lvalue in unary `&) Lucas Machado C Programming 19 04-15-2004 07:29 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57