shithub: puzzles

Download patch

ref: 0417e6335e33c99b84561b17aeba68c118c6f94f
parent: db88c9b9a4d210c26c34bf05efd6c00df584537b
author: Simon Tatham <anakin@pobox.com>
date: Sun Jun 19 17:49:53 EDT 2005

James Harvey's memory leak patch for Flip.

[originally from svn r5980]

--- a/flip.c
+++ b/flip.c
@@ -590,6 +590,8 @@
     sprintf(ret, "%s,%s", mbmp, gbmp);
     sfree(mbmp);
     sfree(gbmp);
+    sfree(matrix);
+    sfree(grid);
     return ret;
 }
 
@@ -731,6 +733,7 @@
 		if (equations[j * (wh+1) + wh]) {
 		    *error = "No solution exists for this position";
 		    sfree(equations);
+		    sfree(und);
 		    return NULL;
 		}
 	    break;
@@ -852,6 +855,7 @@
     sfree(shortest);
     sfree(solution);
     sfree(equations);
+    sfree(und);
 
     return ret;
 }