Index: trunk/psphot/src/image_stats.c
===================================================================
--- trunk/psphot/src/image_stats.c	(revision 4216)
+++ trunk/psphot/src/image_stats.c	(revision 4642)
@@ -35,4 +35,6 @@
 	stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN); 
 	stats = psVectorStats (stats, subset, NULL, NULL, 0); // use a mask?
+	psFree (subset);
+	psFree (rnd)
     }
 
