From 30b3cff6574fbeeda4cfcc54c92e955b04180489 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 3 Apr 2016 12:23:51 +0200 Subject: [PATCH] fix a crash in write_game caused by remove_empty_factions https://bugs.eressea.de/view.php?id=2201 --- src/buildno.h | 2 +- src/kernel/faction.c | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/buildno.h b/src/buildno.h index 3a7947aaa..1b97adf8b 100644 --- a/src/buildno.h +++ b/src/buildno.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 8 -#define VERSION_BUILD 7 +#define VERSION_BUILD 8 diff --git a/src/kernel/faction.c b/src/kernel/faction.c index edb8a9e2f..2699e1b09 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -74,9 +74,6 @@ faction *factions; static void free_faction(faction * f) { funhash(f); - if (f->alliance && f->alliance->_leader == f) { - setalliance(f, 0); - } if (f->msgs) { free_messagelist(f->msgs->begin); free(f->msgs); @@ -454,7 +451,7 @@ void destroyfaction(faction ** fp) } #endif - if (f->alliance && f->alliance->_leader == f) { + if (f->alliance) { setalliance(f, 0); } @@ -681,8 +678,6 @@ void remove_empty_factions(void) if (!(f->_alive && f->units!=NULL) && !fval(f, FFL_NOIDLEOUT)) { log_debug("dead: %s", factionname(f)); destroyfaction(fp); - free_faction(f); - free(f); } else { fp = &(*fp)->next;