From 0a2be8f2b8bab07cf7e02c5b744bc6ef16b5c789 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 8 May 2005 00:03:31 +0000 Subject: [PATCH] add_message memory leak in hunger() extremes memory leak in default_order() --- src/common/kernel/eressea.c | 4 ++-- src/common/kernel/faction.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 00403aec3..b7cb4e14d 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -2734,7 +2734,7 @@ hunger(int number, unit * u) if (dead) { /* Gestorbene aus der Einheit nehmen, * Sie bekommen keine Beerdingung. */ - add_message(&u->faction->msgs, new_message(u->faction, + ADDMSG(&u->faction->msgs, new_message(u->faction, "starvation%u:unit%r:region%i:dead%i:live", u, r, dead, u->number-dead)); scale_number(u, u->number - dead); @@ -3247,7 +3247,7 @@ default_order(const struct locale * lang) struct order * ord; struct orders * next; } * defaults = NULL; - struct orders * olist = NULL; + struct orders * olist = defaults; while (olist) { if (olist->lang==lang) return olist->ord; olist = olist->next; diff --git a/src/common/kernel/faction.h b/src/common/kernel/faction.h index acbb8ba2e..0f6d57c8c 100644 --- a/src/common/kernel/faction.h +++ b/src/common/kernel/faction.h @@ -78,9 +78,9 @@ typedef struct faction { struct ugroup *ugroups; #endif #ifdef MSG_LEVELS + struct msglevel * msglevels; struct warning * warnings; #endif - struct msglevel * msglevels; struct ally *allies; struct group *groups; boolean alive; /* enno: sollte ein flag werden */