I was playing with room events and noticed there is no NULL check when freeing events, like there is for character events:
Code:
case EVENT_ROOM:
room = (struct room_data *) pMudEvent->pStruct;
remove_from_list(pMudEvent->pEvent, room->events);
if (room->events->iSize == 0) {
free_list(room->events);
room->events = NULL;
}
break;
Should be:
Code:
case EVENT_ROOM:
room = (struct room_data *) pMudEvent->pStruct;
remove_from_list(pMudEvent->pEvent, room->events);
if (room->events && (room->events->iSize == 0)) { /* Added the null check here. - Ornir*/
free_list(room->events);
room->events = NULL;
}
break;
Hope this helps.
Ripley/Ornir
Head Coder, LuminariMUD