Index: trunk/psphot/src/psphotStackReadout.c
===================================================================
--- trunk/psphot/src/psphotStackReadout.c	(revision 37466)
+++ trunk/psphot/src/psphotStackReadout.c	(revision 37611)
@@ -344,4 +344,5 @@
     // measure some parameters for galxy science
     psphotGalaxyParams (config, view, STACK_RAW); // pass 1 (detections->allSources)
+
     // create source children for the OUT filerule (for radial aperture photometry and output) 
     // NOTE: The new source children have image arrays pointing to the readout associated with 
@@ -356,4 +357,7 @@
 	return psphotReadoutCleanup (config, view, STACK_RAW);
     }
+    // These arrays are no longer needed. The inputs' sources arrays have references to the data
+    psFree (objects);
+    psFree (objectsOut);
 
     bool radial_apertures = psMetadataLookupBool(NULL, recipe, "RADIAL_APERTURES");
@@ -412,6 +416,4 @@
     // measure aperture photometry corrections
     if (!psphotApResid (config, view, STACK_RAW)) {
-	psFree (objects);
-	psFree (objectsOut);
         psLogMsg ("psphot", 3, "failed on psphotApResid");
 	return psphotReadoutCleanup (config, view, STACK_RAW);
@@ -434,5 +436,5 @@
 
     logMemStats("final");
-#if (1)
+#if (0)
     psphotSourceMemory(config, view, STACK_RAW);
     psphotSourceMemory(config, view, STACK_OUT);
@@ -450,7 +452,4 @@
     psphotStackRemoveChisqFromInputs(config, STACK_RAW);
 #endif
-
-    psFree (objects);
-    psFree (objectsOut);
 
     // create the exported-metadata and free local data
