This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: malloc and free


It's probably a bug in your routine.  However, without seeing your code,
it's hard to give any good answers.  Step through it with a debugger and
make sure that you're not trying to free the same memory more than once,
or access memory that hasn't been allocated yet.

Good luck,
Lyle 

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Ankit Jain
Sent: Friday, December 24, 2004 11:41 AM
To: gcc
Subject: malloc and free

hi

routine xyz uses malloc and free functions. it gives
accurate and correct result if called once. 

but if the function is called in a loop N number of
times then probably it gives segmentation fault.

what is the reason?  can any body guess or test code
is needed?

thanks

ankit jain

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]