diff --git a/src/kernel/race.c b/src/kernel/race.c index 627882d8b..14541346e 100644 --- a/src/kernel/race.c +++ b/src/kernel/race.c @@ -141,6 +141,8 @@ void racelist_insert(struct race_list **rl, const struct race *r) void free_races(void) { while (races) { race * rc = races->next; + free(races->_name); + free(races->def_damage); free(races); races = rc; } diff --git a/src/kernel/race.h b/src/kernel/race.h index b0801e5e5..6882af222 100644 --- a/src/kernel/race.h +++ b/src/kernel/race.h @@ -119,7 +119,7 @@ extern "C" { typedef struct race { struct param *parameters; - const char *_name; + char *_name; float magres; float maxaura; /* Faktor auf Maximale Aura */ float regaura; /* Faktor auf Regeneration */ @@ -133,7 +133,7 @@ extern "C" { float speed; float aggression; /* chance that a monster will attack */ int hitpoints; - const char *def_damage; + char *def_damage; int armor; int at_default; /* Angriffsskill Unbewaffnet (default: -2) */ int df_default; /* Verteidigungsskill Unbewaffnet (default: -2) */ diff --git a/src/kernel/ship.c b/src/kernel/ship.c index afd3dc9f3..b0fc8e06c 100644 --- a/src/kernel/ship.c +++ b/src/kernel/ship.c @@ -238,8 +238,13 @@ void free_ship(ship * s) free(s); } +static void free_shiptype(ship_type *stype) { + free(stype->_name); + free(stype); +} + void free_shiptypes(void) { - ql_foreach(shiptypes, free); + ql_foreach(shiptypes, free_shiptype); ql_free(shiptypes); shiptypes = 0; } diff --git a/src/kernel/ship.h b/src/kernel/ship.h index d879837d8..b493693de 100644 --- a/src/kernel/ship.h +++ b/src/kernel/ship.h @@ -33,7 +33,7 @@ extern "C" { #define SFL_NOCOAST 0x04 typedef struct ship_type { - const char *_name; + char *_name; int range; /* range in regions */ int flags; /* flags */