forked from github/server
leak: free construction materials
This commit is contained in:
parent
457465b4a2
commit
26f5b592bd
|
@ -94,7 +94,10 @@ void bt_register(building_type * type)
|
|||
|
||||
void free_buildingtype(void *ptr) {
|
||||
building_type *btype = (building_type *)ptr;
|
||||
free(btype->construction);
|
||||
if (btype->construction) {
|
||||
free(btype->construction->materials);
|
||||
free(btype->construction);
|
||||
}
|
||||
free(btype->_name);
|
||||
free(btype);
|
||||
}
|
||||
|
|
|
@ -245,7 +245,10 @@ static void free_shiptype(void *ptr) {
|
|||
ship_type *stype = (ship_type *)ptr;
|
||||
free(stype->_name);
|
||||
free(stype->coasts);
|
||||
free(stype->construction);
|
||||
if (stype->construction) {
|
||||
free(stype->construction->materials);
|
||||
free(stype->construction);
|
||||
}
|
||||
free(stype);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue