From a9601a678a0613b388a1bcbd5141759acf6a577f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 27 Sep 2024 12:51:34 +0100 Subject: [PATCH] Untangle: fix a memory leak. Spotted by Leak Sanitiser while re-testing after the previous commits: the separately allocated 'crosses' array in game_state was never freed. --- untangle.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/untangle.c b/untangle.c index 8db6fb0..9196d88 100644 --- a/untangle.c +++ b/untangle.c @@ -966,6 +966,9 @@ static void free_game(game_state *state) freetree234(state->graph->edges); sfree(state->graph); } +#ifndef EDITOR + sfree(state->crosses); +#endif sfree(state->pts); sfree(state); }