Index: /branches/eam_branches/ipp-20110906/psphot/src/psphotFitSourcesLinear.c
===================================================================
--- /branches/eam_branches/ipp-20110906/psphot/src/psphotFitSourcesLinear.c	(revision 32618)
+++ /branches/eam_branches/ipp-20110906/psphot/src/psphotFitSourcesLinear.c	(revision 32619)
@@ -134,4 +134,7 @@
     for (int i = 0; i < sources->n; i++) {
         pmSource *source = sources->data[i];
+
+	// psAssert (source->peak, "source without peak??");
+	// psAssert (source->peak->footprint, "peak without footprint??");
 
         // turn this bit off and turn it on again if we pass this test
Index: /branches/eam_branches/ipp-20110906/psphot/src/psphotGuessModels.c
===================================================================
--- /branches/eam_branches/ipp-20110906/psphot/src/psphotGuessModels.c	(revision 32618)
+++ /branches/eam_branches/ipp-20110906/psphot/src/psphotGuessModels.c	(revision 32619)
@@ -170,4 +170,6 @@
         if (!source->peak) continue;
 
+	// psAssert (source->peak->footprint, "peak without footprint??");
+
         nSrc ++;
 
Index: /branches/eam_branches/ipp-20110906/psphot/src/psphotSourceFits.c
===================================================================
--- /branches/eam_branches/ipp-20110906/psphot/src/psphotSourceFits.c	(revision 32618)
+++ /branches/eam_branches/ipp-20110906/psphot/src/psphotSourceFits.c	(revision 32619)
@@ -357,4 +357,6 @@
     pmSource *newSrc = pmSourceCopy (source);
     newSrc->modelPSF = psMemIncrRefCounter (DBL->data[1]);
+    newSrc->peak->footprint = source->peak->footprint; // just a reference; the peak does not own the footprint
+    psArrayAdd(newSrc->peak->footprint->peaks, 1, newSrc->peak); // the footprint owns the peak
 
     // build cached models and subtract
Index: /branches/eam_branches/ipp-20110906/psphot/src/psphotSourceMatch.c
===================================================================
--- /branches/eam_branches/ipp-20110906/psphot/src/psphotSourceMatch.c	(revision 32618)
+++ /branches/eam_branches/ipp-20110906/psphot/src/psphotSourceMatch.c	(revision 32619)
@@ -234,10 +234,12 @@
 	    
 	    // assign to a footprint on this readout->image
-	    peak->footprint = pmFootprintCopyData(footprint, readout->image);
-
-	    // the peak does not claim ownership of the footprint (it does not free it). save a copy of this 
-	    // footprint on detections->footprints so we can free it later
-	    psArrayAdd(detections->footprints, 100, peak->footprint); 
-	    psFree (peak->footprint);
+	    if (footprint) {
+		peak->footprint = pmFootprintCopyData(footprint, readout->image);
+
+		// the peak does not claim ownership of the footprint (it does not free it). save a copy of this 
+		// footprint on detections->footprints so we can free it later
+		psArrayAdd(detections->footprints, 100, peak->footprint); 
+		psFree (peak->footprint);
+	    }
 	    
 	    // create a new source
Index: /branches/eam_branches/ipp-20110906/psphot/src/psphotSourceStats.c
===================================================================
--- /branches/eam_branches/ipp-20110906/psphot/src/psphotSourceStats.c	(revision 32618)
+++ /branches/eam_branches/ipp-20110906/psphot/src/psphotSourceStats.c	(revision 32619)
@@ -124,4 +124,6 @@
         // add the peak
         source->peak = psMemIncrRefCounter(peak);
+
+	// psAssert (source->peak->footprint, "peak without footprint??");
 
         // allocate space for moments
