memory leak in ibt fixed

This commit is contained in:
Thomas Arp
2011-03-10 22:34:46 +00:00
parent d74b07d8f5
commit 48578939c5
3 changed files with 26 additions and 0 deletions

View File

@@ -877,6 +877,25 @@ static void ibtedit_save(struct descriptor_data *d)
save_ibt_file(OLC_VAL(d));
}
void free_olc_ibt(IBT_DATA *toFree) {
if (!toFree)
return;
if (toFree->text) {
STRFREE(toFree->text);
}
if (toFree->body) {
STRFREE(toFree->body);
}
if (toFree->name) {
STRFREE(toFree->name);
}
if (toFree->notes) {
STRFREE(toFree->notes);
}
free(toFree);
}
/*-------------------------------------------------------------------*/
/* main ibtedit menu function... */
static void ibtedit_disp_main_menu(struct descriptor_data *d)