vis: fix memory leaks in state load/save paths

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-02-12 09:33:31 +10:30
parent 9580847712
commit 5c0826168a
1 changed files with 4 additions and 0 deletions

View File

@ -175,6 +175,9 @@ SaveVisState(void)
SafeWrite(outfile, vis, vis_len);
}
free(might);
free(vis);
err = fclose(outfile);
if (err)
Error("%s: error writing new state (%s)", __func__, strerror(errno));
@ -276,6 +279,7 @@ LoadVisState(void)
p->status = pstat_none;
}
free(compressed);
fclose(infile);
return true;