Re: Malloc problems

From: Sam Moggach (micken69@hotmail.com)
Date: 10/01/02


>the gdb trace is great, but could you alsy send the output of:
>(gdb) frame 2
>(gdb) list
>
>helps to see the surrounding code.
>

// This is the stuff u wanted
(gdb) frame 2
#2  0x8077ca8 in free_char (ch=0x82bf088) at db.c:2836
Source file is more recent than executable.
2836          free(ch->player_specials->host);
(gdb) list
2831        if (ch->player_specials->poofin)
2832          free(ch->player_specials->poofin);
2833        if (ch->player_specials->poofout)
2834          free(ch->player_specials->poofout);
2835        if (ch->player_specials->host)
2836          free(ch->player_specials->host);
2837        free(ch->player_specials);
2838        if (IS_NPC(ch))
2839          log("SYSERR: Mob %s (#%d) had player_specials allocated!",
GET_NAM
E(ch), GET_MOB_VNUM(ch));
2840      }

You were right, the problem IS double freeee-ing
i found the other place it was in the enter_player_game() function... i dont
see exactly how that messes it up. But commenting it out leaves a memory
leak, because when i copyover, it calls the enter_player_game() function and
will skip the part where it frees the memory. But, i will not often spam
copyover 900000 times with 500 people on so it shouldnt pose a big problem.

but if you've got a solution, i'd appreciate it.

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT