aboutsummaryrefslogtreecommitdiff
path: root/filling.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2013-04-13 10:37:27 +0000
committerSimon Tatham <anakin@pobox.com>2013-04-13 10:37:27 +0000
commit339329449f4db72e4754f21c14295303ffe0ea5d (patch)
treedf4cb872091b730d8af32f9f0b8a258e7442b0cd /filling.c
parent0b93de904a98f119b1a95d3a53029f1ed4bfb9b3 (diff)
downloadpuzzles-339329449f4db72e4754f21c14295303ffe0ea5d.zip
puzzles-339329449f4db72e4754f21c14295303ffe0ea5d.tar.gz
puzzles-339329449f4db72e4754f21c14295303ffe0ea5d.tar.bz2
puzzles-339329449f4db72e4754f21c14295303ffe0ea5d.tar.xz
Fix a memory management bug in Filling: in some situations its
solve_game() was returning its aux parameter un-dupstr()ed, which is wrong. Also clarified the developer docs on that function to make it clearer that the returned string should be dynamic. [originally from svn r9831]
Diffstat (limited to 'filling.c')
-rw-r--r--filling.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/filling.c b/filling.c
index 4cd4318..cad0733 100644
--- a/filling.c
+++ b/filling.c
@@ -975,7 +975,7 @@ static char *solve_game(game_state *state, game_state *currstate,
if (!solver(state->board, w, h, &aux))
*error = "Sorry, I couldn't find a solution";
}
- return aux;
+ return dupstr(aux);
}
/*****************************************************************************