diff --git a/src/piracy.test.c b/src/piracy.test.c index dee326980..419f73073 100644 --- a/src/piracy.test.c +++ b/src/piracy.test.c @@ -47,6 +47,7 @@ static void setup_pirate(unit **pirate, int p_r_flags, int p_rc_flags, const cha if (v_shiptype) { st_boat = st_get_or_create(v_shiptype); u_set_ship(*victim, test_create_ship((*victim)->region, st_boat)); + free(st_boat->coasts); st_boat->coasts = (struct terrain_type **)calloc(2, sizeof(struct terrain_type *)); st_boat->coasts[0] = vterrain; st_boat->coasts[1] = 0; @@ -59,6 +60,7 @@ static void setup_pirate(unit **pirate, int p_r_flags, int p_rc_flags, const cha if (p_shiptype) { st_boat = st_get_or_create(p_shiptype); u_set_ship(*pirate, test_create_ship((*pirate)->region, st_boat)); + free(st_boat->coasts); st_boat->coasts = (struct terrain_type **)calloc(2, sizeof(struct terrain_type *)); st_boat->coasts[0] = vterrain; st_boat->coasts[1] = 0;