Index: trunk/psphot/src/psphotReadoutCleanup.c
===================================================================
--- trunk/psphot/src/psphotReadoutCleanup.c	(revision 14655)
+++ trunk/psphot/src/psphotReadoutCleanup.c	(revision 16820)
@@ -1,8 +1,8 @@
 # include "psphotInternal.h"
 
-// psphotReadoutCleanup is called on exit from psphotReadout if the last raised
-// error is not a DATA error, then there was a serious problem.  only in this
-// case, or if the fail on the stats measurement, do we return false
-bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmPSF *psf, psArray *sources) {
+// psphotReadoutCleanup is called on exit from psphotReadout.  If the last raised error is
+// not a DATA error, then there was a serious problem.  Only in this case, or if the fail
+// on the stats measurement, do we return false
+bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmDetections *detections, pmPSF *psf, psArray *sources) {
 
     // remove internal pmFPAfiles, if created
@@ -73,4 +73,5 @@
     pmKapaClose ();
 
+    psFree (detections);
     psFree (psf);
     psFree (header);
