Index: trunk/psModules/src/camera/pmFPAfileDefine.c
===================================================================
--- trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 18031)
+++ trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 18033)
@@ -21,4 +21,10 @@
 
 #include "pmConcepts.h"
+
+# define FPA_TEST_ASSERT(A){ \
+	assert(A->format == NULL); \
+	assert(A->formatName == NULL); \
+	assert(A->filerule == NULL); \
+	assert(A->filesrc == NULL); }
 
 // Parse an option from a metadata, returning the appropriate integer value
@@ -511,10 +517,10 @@
         return NULL;
     }
+    psFree (file->filerule); // this is set in pmFPAfileDefineInput 
     file->format = format;
     file->formatName = formatName;
-
-    // adjust the rules to identify these files in the file->names data
     file->filerule = psStringCopy("@FILES");
     file->filesrc = psStringCopy("{CHIP.NAME}.{CELL.NAME}");
+    // we use the above rules to identify these files in the file->names data
 
     file->fileLevel = pmFPAPHULevel(format);
@@ -655,4 +661,5 @@
 
     // define the rule to identify these files in the file->names data
+    FPA_TEST_ASSERT (file);
     psFree (file->filerule);
     psFree (file->filesrc);
@@ -825,10 +832,10 @@
         return NULL;
     }
+    FPA_TEST_ASSERT (file);
     file->format = format;
     file->formatName = formatName;
-
-    // adjust the rules to identify these files in the file->names data
     file->filerule = psStringCopy ("@FILES");
     file->filesrc = psStringCopy ("{CHIP.NAME}.{CELL.NAME}");
+    // adjust the above rules to identify these files in the file->names data
 
     file->fileLevel = pmFPAPHULevel(format);
