Alright, after being plagued with mem-leaks for a while, I've got a question 
for the group.  I found a site at 
http://www.mageslair.net/mage_snippets/buglisting.txt which details a few 
mem-leaks from ROM.  I'm wonder if anybody has had experience dealing with this 
instance and in fact it does leak memory here.



----------------------------------------------------------------

Ok, I've found some more stock ROM memory leaks...  damn.

These are all in save.c.

In fread_char():

     KEY( "Clan", ch->clan, clan_lookup(fread_string(fp)));

The problem with this is, fread_string() is going to str_dup() whatever
it reads in... and this never gets freed.  To fix this, you have to
keep a pointer to the string you read in:

if ( !str_cmp( word, "Clan" ) )
{
     char *tmp = fread_string(fp);
     ch->clan = clan_lookup(tmp);
     free_string(tmp);
     fMatch = TRUE;
     break;
}

Reply via email to