From c1e86e4fa09efd341c5050f68764b950797a7c85 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 4 Jun 2005 01:43:38 +0000 Subject: [PATCH] - asserting on valid return values from recruit-function - fixing crashbug with --lomem) --- src/common/gamecode/economy.c | 15 ++++++++------- src/common/kernel/region.c | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 4137194ca..22886ebb3 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -389,21 +389,22 @@ expandrecruit(region * r, request * recruitorders) /* centaurs: */ recruits = select_recruitment(&recruitorders, horse_recruiters, &total); if (recruits) { - int horses = rhorses(r) * 2; + int recruited, horses = rhorses(r) * 2; if (totalindividual_messages) { struct individual_message * msg = r->individual_messages; r->individual_messages = msg->next; - free_messagelist(msg->msgs); + if (msg->msgs) free_messagelist(msg->msgs); free(msg); }