Index: trunk/psphot/src/psphotSourceStats.c
===================================================================
--- trunk/psphot/src/psphotSourceStats.c	(revision 6379)
+++ trunk/psphot/src/psphotSourceStats.c	(revision 6427)
@@ -25,5 +25,4 @@
 
 	// allocate image, weight, mask arrays for each peak (square of radius OUTER)
-	// XXX EAM : this has 12 leaks (v.5)
 	psphotDefinePixels (source, readout, source->peak->x, source->peak->y, OUTER);
 
@@ -31,4 +30,12 @@
 	// XXX EAM : this should use ROBUST not SAMPLE median, but it is broken
 	status = pmSourceLocalSky (source, PS_STAT_SAMPLE_MEDIAN, INNER);
+	if (!status) {
+	  psFree (source);
+	  continue;
+	}
+
+	// measure the local sky variance (needed if noise is not sqrt(signal))
+	// XXX EAM : this should use ROBUST not SAMPLE median, but it is broken
+	status = pmSourceLocalSkyVariance (source, PS_STAT_SAMPLE_MEDIAN, INNER);
 	if (!status) {
 	  psFree (source);
