Index: /trunk/dvoTools/src/dvoMakeCorrUnbin.c
===================================================================
--- /trunk/dvoTools/src/dvoMakeCorrUnbin.c	(revision 20372)
+++ /trunk/dvoTools/src/dvoMakeCorrUnbin.c	(revision 20373)
@@ -43,4 +43,5 @@
 	pmChip *outChip = pmFPAviewThisChip (myView, outFile->fpa);
 	pmCell *outCell = pmFPAviewThisCell (myView, outFile->fpa);
+	assert (outCell);
 
 	pmChipCopyStructure (outChip, refChip, 1, 1);
@@ -48,7 +49,4 @@
 	outData = pmReadoutAlloc (outCell);
 	assert (outData != NULL);
-
-	// outData = pmFPAviewThisReadout (myView, outFile->fpa);
-	// assert (outData != NULL);
     }
 
@@ -59,4 +57,5 @@
     if (!psImageUnbin (outData->image, inImage, binning)) {
 	psError (PS_ERR_UNKNOWN, true, "failed to unbin image");
+	psFree (myView);
 	psFree (binning);
 	return false;
@@ -71,10 +70,7 @@
     }
 
-    // psFits *fits = psFitsOpen ("tmp.fits", "w");
-    // psFitsWriteImage (fits, NULL, outData->image, 0, NULL);
-    // psFitsClose (fits);
-    // exit (0);
-
+    psFree (myView);
     psFree (binning);
+ 
     return true;
 }
