memory leaks

- must free gamedata after close
- clear spellbook and free it
This commit is contained in:
Enno Rehling 2016-03-11 09:43:16 +01:00
parent be0cc93917
commit 0f792e038f
2 changed files with 3 additions and 1 deletions

View File

@ -405,7 +405,8 @@ static void test_write_spell_syntax(CuTest *tc) {
set_parameter(spell, "kc+");
check_spell_syntax(tc, "kc+", &spell,
" ZAUBERE \"Testzauber\" ( REGION | EINHEIT <enr> [<enr> ...] | SCHIFF <snr>\n [<snr> ...] | BURG <bnr> [<bnr> ...] )");
spellbook_clear(spell.spb);
free(spell.spb);
test_cleanup();
}

View File

@ -14,6 +14,7 @@ static void test_gamedata(CuTest * tc)
data = gamedata_open("test.dat", "rb", 0);
CuAssertPtrNotNull(tc, data);
gamedata_close(data);
free(data);
CuAssertIntEquals(tc, 0, remove("test.dat"));
}