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:
PatR
2019-02-08 15:50:59 -08:00
parent e991dd1b0c
commit f3072cdb43
2 changed files with 24 additions and 20 deletions
+1 -1
View File
@@ -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;
}