chiark / gitweb /
Fix a memory leak in Range's find_errors.
[sgt-puzzles.git] / range.c
diff --git a/range.c b/range.c
index 391bdc858dfaa020eeba484e704584272d912a85..4347f7697d1c25f84ca0d3322ffe49e57c35c7e2 100644 (file)
--- a/range.c
+++ b/range.c
@@ -1167,7 +1167,7 @@ static char *game_text_format(const game_state *state)
     cellsize = 0; /* or may be used uninitialized */
 
     for (c = 0; c < w; ++c) {
-        for (r = 1; r < h; ++r) {
+        for (r = 0; r < h; ++r) {
             puzzle_size k = state->grid[idx(r, c, w)];
             int d;
             for (d = 0; k; k /= 10, ++d);
@@ -1451,7 +1451,7 @@ static int find_errors(const game_state *state, int *report)
         int biggest, canonical;
 
         if (!report) {
-            printf("dfs fail at %d\n", any_white_cell);
+            sfree(dsf);
             goto found_error;
         }