Index: trunk/ppSub/src/ppSubInputDetections.c
===================================================================
--- trunk/ppSub/src/ppSubInputDetections.c	(revision 29937)
+++ trunk/ppSub/src/ppSubInputDetections.c	(revision 30619)
@@ -118,4 +118,5 @@
 	if (!psMetadataCopy(sourcesHDU->header, imageHDU->header)) {
 	    psError(PPSUB_ERR_PROG, false, "Unable to copy header");
+	    psFree(view);
 	    return false;
 	}
@@ -130,8 +131,10 @@
     if (!psphotCopyResults (foundDetections, sourcesFile, photFile, view)) {
 	psError(PPSUB_ERR_PROG, false, "Unable to copy psphot outputs");
+	psFree(view);
 	return false;
     }
     // if no sources were found here, we report that back and let them handle it
 
+    psFree(view);
     return true;
 }
