Index: branches/simmosaic_branches/psphot/src/psphotDiagnosticPlots.c
===================================================================
--- branches/simmosaic_branches/psphot/src/psphotDiagnosticPlots.c	(revision 24860)
+++ branches/simmosaic_branches/psphot/src/psphotDiagnosticPlots.c	(revision 27839)
@@ -68,4 +68,5 @@
     if (!psVectorStats (stats, histogram->nums, NULL, NULL, 0)) {
 	psError(PS_ERR_UNKNOWN, false, "failure to measure stats for histogram");
+	psFree(histogram);
         return false;
     }
@@ -108,4 +109,5 @@
     if (!psVectorStats (stats, histogram->nums, NULL, NULL, 0)) {
 	psError(PS_ERR_UNKNOWN, false, "failure to measure stats for histogram");
+	psFree(histogram);
         return false;
     }
