Index: /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/include/dvomerge.h
===================================================================
--- /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/include/dvomerge.h	(revision 38496)
+++ /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/include/dvomerge.h	(revision 38497)
@@ -174,4 +174,5 @@
 off_t 	   dvo_map_image_ID       PROTO((IDmapType *IDmap, off_t oldID));
 int   	   dvo_update_image_IDs   PROTO((IDmapType *IDmap, Catalog *catalog));
+void       dvo_image_map_free     PROTO((IDmapType *IDmap));
 
 // dvorepair prototypes
Index: /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c
===================================================================
--- /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c	(revision 38496)
+++ /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c	(revision 38497)
@@ -5,4 +5,11 @@
 void SortTgtByTimes (e_time *S, off_t *I, short *C, off_t N);
 off_t getTgtIndex (e_time start, e_time stop, short photcode, off_t *TgtIndex, e_time *TgtTimes, short *TgtCodes, off_t NimagesTgt);
+
+void dvo_image_map_free (IDmapType *IDmap) {
+  // we don't own the IDmap, just the elements
+  free (IDmap->old);
+  free (IDmap->old);
+  free (IDmap->notFound);
+}
 
 // we have two tables; 'tgt' contains some exposures from 'src' : find them and match a map
Index: /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvomergeImageIDs.c
===================================================================
--- /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvomergeImageIDs.c	(revision 38496)
+++ /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvomergeImageIDs.c	(revision 38497)
@@ -81,4 +81,7 @@
   dvo_image_unlock (&outDB); // unlock output
 
+  gfits_db_free (inDB);
+  gfits_db_free (outDB);
+
   return TRUE;
 }
@@ -136,4 +139,7 @@
   dvo_image_match_dbs(IDmap, &outDB, &inDB);
 
+  gfits_db_free (inDB);
+  gfits_db_free (outDB);
+
   return TRUE;
 }
Index: /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvomergeUpdate.c
===================================================================
--- /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvomergeUpdate.c	(revision 38496)
+++ /branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvomergeUpdate.c	(revision 38497)
@@ -112,4 +112,5 @@
 
   int status = dvomergeUpdate_catalogs (input, output, outsky, inlist, NsecfiltInput, NsecfiltOutput, &IDmap, secfiltMap);
+  dvo_image_map_free (&IDmap);
 
   // save the output sky table copy
@@ -121,4 +122,6 @@
   }
 
+  ohana_memcheck (TRUE);
+
   if (!status) {
     MARKTIME ("ERROR: elapsed time %9.4f sec\n", dtime);
