diff --git a/src/kernel/item.c b/src/kernel/item.c index 4aab13112..ba6504746 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -1178,12 +1178,17 @@ static item *default_spoil(const struct race *rc, int size) return itm; } -int free_itype(item_type *itype) { +static void free_itype(item_type *itype) { free(itype->construction); free(itype->_appearance[0]); free(itype->_appearance[1]); free(itype); - return 0; +} + +static void free_wtype(weapon_type *wtype) { + free(wtype->damage[0]); + free(wtype->damage[1]); + free(wtype); } int free_rtype_cb(const void * match, const void * key, size_t keylen, void *cbdata) { @@ -1193,6 +1198,9 @@ int free_rtype_cb(const void * match, const void * key, size_t keylen, void *cbd if (rtype->itype) { free_itype(rtype->itype); } + if (rtype->wtype) { + free_wtype(rtype->wtype); + } free(rtype); return 0; } diff --git a/src/kernel/item.h b/src/kernel/item.h index 449445a7d..fc3c2c909 100644 --- a/src/kernel/item.h +++ b/src/kernel/item.h @@ -211,7 +211,7 @@ extern "C" { typedef struct weapon_type { const item_type *itype; - const char *damage[2]; + char *damage[2]; unsigned int flags; skill_t skill; int minskill;