Re: Memory leaks

From: Michael Buselli (
Date: 02/26/96

On Mon, 26 Feb 1996, Michael Buselli wrote:

>      The do_set() function in act.wizard.c has a memory leak when you 
> "set file player something value" if the field you set does a direct 
> return from the middle of the switch statment because then the temporary 
> char_data struct that was allocated is not freed.  I did something to the 
> effect of this in my circle 3.0 code:
> #define RETURN { if (is_file) free_char(cbuf); return; }
> And that'll fix that problem.  If there are other leaks, good luck 
> finding them because they could be anywhere.

     I should clarify that in the middle of the switch you need to change
all instances of return; with RETURN; for it to work. 

Michael Buselli

This archive was generated by hypermail 2b30 : 12/07/00 PST