From 5c0826168abc282465d3c009818b3a53e0569e6c Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Tue, 12 Feb 2013 09:33:31 +1030 Subject: [PATCH] vis: fix memory leaks in state load/save paths Signed-off-by: Kevin Shanahan --- vis/state.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vis/state.c b/vis/state.c index bf9e513c..751c0bba 100644 --- a/vis/state.c +++ b/vis/state.c @@ -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;