curses: plug most memory leaks
This takes care of a lot of the leaked memory in the curses interface. It still needs to free memory allocated for status fields when the status window is destroyed at game end; likewise for message history when the message window is destroyed.
This commit is contained in:
@@ -617,11 +617,11 @@ mesg_add_line(char *mline)
|
||||
current_mesg->prev_mesg = last_mesg;
|
||||
last_mesg = current_mesg;
|
||||
|
||||
|
||||
if (num_messages < max_messages) {
|
||||
num_messages++;
|
||||
} else {
|
||||
tmp_mesg = first_mesg->next_mesg;
|
||||
free(first_mesg->str);
|
||||
free(first_mesg);
|
||||
first_mesg = tmp_mesg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user