Originally Posted by
MK27
Maybe your problem is not realloc at all. If you have an overflow somewhere else, these can sometimes show up and cause "a crash" after you have changed some completely unrelated piece of code, because it involves the location of data in memory.
That would make it a difficult problem to solve, and lead you to believe it's just the one change you made that did it.
However, you could at least try to use a debugger and find out why the segfault happens (if it is a segmentation fault, you still haven't explained what happens; keep in mind that there is a lot of reasons a program can suddenly stop running, usually accompanied by some kind of informative message. If you're just a user, say "crash", if you're the programmer, you better figure out what that really means).