forked from github/server
memory leaks
- must free gamedata after close - clear spellbook and free it
This commit is contained in:
parent
be0cc93917
commit
0f792e038f
|
@ -405,7 +405,8 @@ static void test_write_spell_syntax(CuTest *tc) {
|
||||||
set_parameter(spell, "kc+");
|
set_parameter(spell, "kc+");
|
||||||
check_spell_syntax(tc, "kc+", &spell,
|
check_spell_syntax(tc, "kc+", &spell,
|
||||||
" ZAUBERE \"Testzauber\" ( REGION | EINHEIT <enr> [<enr> ...] | SCHIFF <snr>\n [<snr> ...] | BURG <bnr> [<bnr> ...] )");
|
" ZAUBERE \"Testzauber\" ( REGION | EINHEIT <enr> [<enr> ...] | SCHIFF <snr>\n [<snr> ...] | BURG <bnr> [<bnr> ...] )");
|
||||||
|
spellbook_clear(spell.spb);
|
||||||
|
free(spell.spb);
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ static void test_gamedata(CuTest * tc)
|
||||||
data = gamedata_open("test.dat", "rb", 0);
|
data = gamedata_open("test.dat", "rb", 0);
|
||||||
CuAssertPtrNotNull(tc, data);
|
CuAssertPtrNotNull(tc, data);
|
||||||
gamedata_close(data);
|
gamedata_close(data);
|
||||||
|
free(data);
|
||||||
CuAssertIntEquals(tc, 0, remove("test.dat"));
|
CuAssertIntEquals(tc, 0, remove("test.dat"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue