Since I haven't seen this on any mem-leak sites, I thought I would post
this.

In nanny(), gen_data is alloced, but only freed if the user types 'done' in
skill/group selection part of creation. Of course, the only way to get out
of typing 'done' is by disconnecting while picking your skills, which is
not an uncommon thing mind you...

Fix:
Stick this in your free_char:

    if ( ch->gen_data )
    {
        free_gen_data( ch->gen_data );
        ch->gen_data = NULL;
    }

Wow...so simple you might have thought they would have done it originally...

This fix will save you (2*MAX_SKILL)+(2*MAX_GROUP)+7 bytes (add 8 to that
if you use OLC2.0) per person that disconnects while in skill selection.
Not significant by any means, but it will add up.

Ammaross Danan,
saving the world, one bug at a time.



Reply via email to