Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!unmvax!ncar!boulder!pikes!udenva!isis!csm9a!ddale From: ddale@csm9a.UUCP (Doug Dale) Newsgroups: comp.lang.c Subject: A "simple" realloc() question. Message-ID: <1606@csm9a.UUCP> Date: 13 Jun 89 16:53:08 GMT Organization: Colorado School of Mines Lines: 15 I am writing a program that dynamically allocates space to store strings, and I have a question that a large number of manuals and C books won't answer for me. When using realloc(), if it is necessary to move the information to another location in memory because more memory is needed, is the old memory freed? I could simply check after calling realloc to see if the position has changed, and then free the old area if necessary, but I seem to remember hearing that freeing space that is already 'free' can be dangerous. So it might cause problems if realloc() does free memory, and then I try to free it again. You would think that I could find such information in any C manual, but... ddale@csm9a.colorado.EDU