Index: trunk/psphot/src/find_peaks.c
===================================================================
--- trunk/psphot/src/find_peaks.c	(revision 4215)
+++ trunk/psphot/src/find_peaks.c	(revision 4216)
@@ -16,10 +16,8 @@
     NSIGMA = psMetadataLookupF32 (&status, config, "SMOOTH_NSIGMA");
 
-    psImage *image  = imdata->image;
-    psImage *smooth = psImageCopy (NULL, image, PS_TYPE_F32);
+    psImage *smooth = psImageCopy (NULL, imdata->image, PS_TYPE_F32);
     psImageSmooth (smooth, SIGMA, NSIGMA);
 
     psLogMsg ("psphot", 4, "smooth: %f sec\n", psTimerMark ("psphot"));
-
 
     // find the peaks in the smoothed image 
@@ -33,4 +31,5 @@
     psArray *peaks = pmFindImagePeaks (smooth, threshold);
     if (peaks == NULL) psAbort ("find peaks", "no peaks found");
+    psFree (smooth);
     // XXX Need to gracefully handle no source detections
 
