Hi all,
I have found/created a crash that I'd like to run past the community:
It happened immediately after implementing my points regeneration patch that I posted in the Snippets section (haha yeah I know..)
So the crash happens like this:
Log a character into the Mud and run around a bit - this creates the event to regenerate movement points.
Reconnect to the Mud and log in using the same character, as soon as you enter the password the crash happens.
Code:
free_list (pList=0x0)
free_char (ch=0x601476180)
perform_dupe_check (d=0x601477790)
nanny (d=0x601477790, d@entry=0x601477790, arg=0xffffc480 \"Password1\", arg@entry=0xffffc480 \"Password1\")
game_loop (local_mother_desc=3)
init_game (local_port=4000)
main (argc=1, argv=<optimized out>)
In this case free_list() is called from free_char(), it's when all the events are being cleaned up. For some reason NULL is being sent to free_list().
And it is here that I made the following change:
Code:
db.c, free_char() @ line 3222
/* Mud Events */
if (ch->events != NULL) {
if (ch->events->iSize > 0) {
struct event * pEvent;
while ((pEvent = simple_list(ch->events)) != NULL)
event_cancel(pEvent);
}
+ if(ch->events)
free_list(ch->events);
ch->events = NULL;
}
This fixes the crash.
So I'm wondering, is skipping free_list(ch->events) in this case OK ? Or am I causing memory troubles further down the road?
If someone could idiot check my thinking here it would be much appreciated