From ea5866863cbdad80eb69351417018c6104c5f43b Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 19 Jan 2010 20:33:25 +0100 Subject: fixed a few memory leaks --- src/map/magic-stmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/map/magic-stmt.c') diff --git a/src/map/magic-stmt.c b/src/map/magic-stmt.c index 1a1ced7..93ef65f 100644 --- a/src/map/magic-stmt.c +++ b/src/map/magic-stmt.c @@ -1161,7 +1161,7 @@ static effect_t *run_foreach (invocation_t * invocation, effect_t * foreach, cont_activation_record_t *ar = add_stack_entry (invocation, CONT_STACK_FOREACH, return_location); int entities_allocd = 64; - int *entities_collect = malloc (entities_allocd * sizeof (int)); + int *entities_collect; int *entities; int *shuffle_board; int entities_nr = 0; @@ -1170,6 +1170,8 @@ static effect_t *run_foreach (invocation_t * invocation, effect_t * foreach, if (!ar) return return_location; + entities_collect = malloc (entities_allocd * sizeof (int)); + find_entities_in_area (area.v.v_area, &entities_allocd, &entities_nr, &entities_collect, filter); -- cgit v1.2.3-60-g2f50