Index: trunk/pois/src/pois.c
===================================================================
--- trunk/pois/src/pois.c	(revision 3797)
+++ trunk/pois/src/pois.c	(revision 3813)
@@ -114,8 +114,10 @@
 
     // Iterate for a good solution
-    bool badStamps = true;		// Do we have bad stamps, such that we need to continue to iterate?
+    psList *badStamps = NULL;		// Do we have bad stamps, such that we need to continue to iterate?
     for (int iterNum = 0; iterNum < config->numIter && badStamps; iterNum++) {
 	psTrace("pois", 1, "Iteration %d...\n", iterNum);
 
+	psFree(badStamps);		// left over from last iteration
+	
 	// Find stamps
 	stamps = poisFindStamps(stamps, refImage, mask, config);
@@ -175,4 +177,5 @@
     // If there was rejection on the last round, re-solve the equation using only the good stamps
     if (badStamps) {
+	psFree(badStamps);
 	solution = poisSolveEquation(solution, stamps, config);
     }
