Memory Leaks:

- Kampf
- Globalreport, Adressen
- XPath
- at_luxuries
This commit is contained in:
Enno Rehling 2005-05-08 00:16:32 +00:00
parent d61e5eae56
commit 71ee47751a
4 changed files with 13 additions and 7 deletions

View File

@ -1617,8 +1617,14 @@ make_cmd(unit * u, struct order * ord)
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
static void
free_luxuries(struct attrib * a)
{
i_freeall((item*)a->data.v);
}
const attrib_type at_luxuries = { const attrib_type at_luxuries = {
"luxuries", NULL, NULL, NULL, NULL, NULL "luxuries", NULL, free_luxuries, NULL, NULL, NULL
}; };
static void static void

View File

@ -2592,8 +2592,8 @@ global_report(const char * filename)
add_seen(seen, r, see_unit, true); add_seen(seen, r, see_unit, true);
} }
report_computer(F, monsters, seen, addresses, time(NULL)); report_computer(F, monsters, seen, addresses, time(NULL));
freelist(addresses);
seen_done(seen); seen_done(seen);
fclose(F); fclose(F);
} }

View File

@ -3228,16 +3228,18 @@ free_battle(battle * b)
side *side; side *side;
fighter *fighter; fighter *fighter;
meffect *meffect; meffect *meffect;
bfaction * bf;
int max_fac_no = 0; int max_fac_no = 0;
if (bdebug) { if (bdebug) {
fclose(bdebug); fclose(bdebug);
} }
for (bf=b->factions;bf;bf=bf->next) { while (b->factions) {
bfaction * bf = b->factions;
faction * f = bf->faction; faction * f = bf->faction;
b->factions = bf->next;
max_fac_no = max(max_fac_no, f->no); max_fac_no = max(max_fac_no, f->no);
free(bf);
} }
cv_foreach(side, b->sides) { cv_foreach(side, b->sides) {
@ -3257,9 +3259,6 @@ free_battle(battle * b)
} }
cv_next(meffect); cv_next(meffect);
cv_kill(&b->meffects); cv_kill(&b->meffects);
/*
cv_kill(&b->factions);
*/
} }
static int * static int *

View File

@ -504,6 +504,7 @@ xml_readweapon(xmlXPathContextPtr xpath, item_type * itype)
xmlFree(property); xmlFree(property);
} }
} }
xmlXPathFreeObject(races);
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);