From 304ac20747c11f3d67560ddd2d6f3318e69c9bfa Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 30 Apr 2005 11:46:11 +0000 Subject: [PATCH] memory leaked by item reports in the CR. --- src/common/gamecode/creport.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index 1755976e3..4442f1aa2 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -864,7 +864,15 @@ cr_output_unit(FILE * F, const region * r, } fprintf(F, "%d;%s\n", in, add_translation(ic, locale_string(f->locale, ic))); } - + if (show!=u->items) { + /* free the temporary items */ + while (show) { + item * ishow = show; + show = show->next; + i_free(ishow); + } + } + if ((u->faction == f || omniscient(f)) && u->botschaften) cr_output_str_list(F, "EINHEITSBOTSCHAFTEN", u->botschaften, f);