diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 074d8386f..95f47de7b 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -883,8 +883,6 @@ rp_battles(FILE * F, faction * f) centre(F, buf, true); rnl(F); rp_messages(F, bm->msgs, f, 0, true, false); - free_messagelist(bm->msgs); - free(bm); } } } diff --git a/src/common/kernel/curse.h b/src/common/kernel/curse.h index 3331cda88..8504e200d 100644 --- a/src/common/kernel/curse.h +++ b/src/common/kernel/curse.h @@ -325,8 +325,6 @@ extern boolean curse_active(const curse * c); extern const char * oldcursename(int id); extern void register_curses(void); -#define get_oldcurse(id) \ - get_curse(a, ct_find(oldcursename(id))) #define is_cursed(a, id, id2) \ curse_active(get_curse(a, ct_find(oldcursename(id)))) #define get_curseeffect(a, id, id2) \ diff --git a/src/common/kernel/faction.c b/src/common/kernel/faction.c index 0c4a99280..70ca92f94 100644 --- a/src/common/kernel/faction.c +++ b/src/common/kernel/faction.c @@ -18,6 +18,7 @@ #include "unit.h" #include "race.h" #include "region.h" +#include "message.h" #include "plane.h" #include "item.h" #include "group.h" @@ -179,7 +180,14 @@ destroyfaction(faction * f) unit *u; faction *ff; - if( !f->alive ) return; + if (!f->alive) return; + + while (f->battles) { + struct bmsg * bm = f->battles; + f->battles = bm->next; + free_messagelist(bm->msgs); + free(bm); + } for (u=f->units;u;u=u->nextF) { region * r = u->region;