Menu

#5 Error in using realloc

open
nobody
None
5
2005-07-08
2005-07-08
Anonymous
No

Caught this in FreeBSD, in configuration.c, preparehtml
kept giving pointer to wrong page. Looked at the
realloc lines and found it should be written
tmp=realloc(tmp, tmpsize);
missing the tmp=. Works ok if realloc is only called
once, but I was getting it to call twice. Without the
reassignment of tmp, still used the old value of tmp
which is not in the alloc table anymore. I also added
a test and die if realloc failed.

Submitted by mike at packards-home dot net.

Discussion


Log in to post a comment.