Index: trunk/psModules/src/objects/pmSourceIO.c
===================================================================
--- trunk/psModules/src/objects/pmSourceIO.c	(revision 9387)
+++ trunk/psModules/src/objects/pmSourceIO.c	(revision 9560)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-07 03:54:29 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-14 00:53:56 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -207,15 +207,14 @@
         outhead = psMetadataCopy (NULL, hdu->header);
 
-        // copy over the entries saved in the
-        updates = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.HEADER");
+        // copy over the entries saved by PSPHOT
+        updates = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.HEADER");
         if (updates) {
             psMetadataCopy (outhead, updates);
-            psFree (updates);
-        }
-
-        updates = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.HEADER");
+        }
+
+        // copy over the entries saved by PSASTRO
+        updates = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.HEADER");
         if (updates) {
             psMetadataCopy (outhead, updates);
-            psFree (updates);
         }
 
@@ -270,5 +269,12 @@
             // XXX : see note below about DVO/addstar expectations
             updates = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.HEADER");
-            psMetadataCopy (outhead, updates);
+            if (updates) {
+                psMetadataCopy (outhead, updates);
+            }
+
+            updates = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.HEADER");
+            if (updates) {
+                psMetadataCopy (outhead, updates);
+            }
 
             psFitsWriteBlank (file->fits, outhead, headname);
