mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-28 14:31:44 +01:00
memory leak in ibt fixed
This commit is contained in:
19
src/ibt.c
19
src/ibt.c
@@ -877,6 +877,25 @@ static void ibtedit_save(struct descriptor_data *d)
|
|||||||
|
|
||||||
save_ibt_file(OLC_VAL(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... */
|
/* main ibtedit menu function... */
|
||||||
static void ibtedit_disp_main_menu(struct descriptor_data *d)
|
static void ibtedit_disp_main_menu(struct descriptor_data *d)
|
||||||
|
|||||||
@@ -98,3 +98,4 @@ void load_ibt_file(int mode);
|
|||||||
void ibtedit_parse(struct descriptor_data *d, char *arg);
|
void ibtedit_parse(struct descriptor_data *d, char *arg);
|
||||||
void ibtedit_string_cleanup(struct descriptor_data *d, int terminator);
|
void ibtedit_string_cleanup(struct descriptor_data *d, int terminator);
|
||||||
void free_ibt_lists();
|
void free_ibt_lists();
|
||||||
|
void free_olc_ibt(IBT_DATA *toFree);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "act.h"
|
#include "act.h"
|
||||||
#include "handler.h" /* for is_name */
|
#include "handler.h" /* for is_name */
|
||||||
#include "quest.h"
|
#include "quest.h"
|
||||||
|
#include "ibt.h"
|
||||||
|
|
||||||
|
|
||||||
/* Internal Data Structures */
|
/* Internal Data Structures */
|
||||||
@@ -174,6 +175,11 @@ void cleanup_olc(struct descriptor_data *d, byte cleanup_type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OLC_IBT(d)) {
|
||||||
|
free_olc_ibt(OLC_IBT(d));
|
||||||
|
OLC_IBT(d) = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Free storage if allocated (tedit, aedit, and trigedit). This is the command
|
/* Free storage if allocated (tedit, aedit, and trigedit). This is the command
|
||||||
* list - it's been copied to disk already, so just free it -Welcor. */
|
* list - it's been copied to disk already, so just free it -Welcor. */
|
||||||
if (OLC_STORAGE(d)) {
|
if (OLC_STORAGE(d)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user