Index: trunk/ippTools/src/pxframes.c
===================================================================
--- trunk/ippTools/src/pxframes.c	(revision 8012)
+++ trunk/ippTools/src/pxframes.c	(revision 8013)
@@ -24,6 +24,6 @@
     psMemSetDeallocator(frame, (psFreeFunc)frametype##Free); \
  \
-    frame->exposure = exposure; \
-    frame->images   = images; \
+    frame->exposure = psMemIncrRefCounter(exposure); \
+    frame->images   = psMemIncrRefCounter(images); \
  \
     return frame; \
@@ -34,5 +34,4 @@
     psFree(ptr->exposure); \
     psFree(ptr->images); \
-    psFree(ptr); \
 }
 
@@ -61,4 +60,5 @@
             psMetadata *md = imfiletype##MetadataFromObject(image); \
             psMetadataAddMetadata(output, PS_LIST_TAIL, #imfiletype,  PS_META_DUPLICATE_OK, NULL, md); \
+            psFree(md); \
         } \
     } \
@@ -111,6 +111,10 @@
  \
         frametype *frame = frametype##Alloc(exposure, images); \
+        psFree(images); \
         psArrayAdd(allFrames, 100, frame); \
-    } \
+        psFree(frame); \
+    } \
+ \
+    psFree(exposures); \
  \
     if (!psArrayLength(allFrames)) { \
Index: trunk/ippTools/src/regtool.c
===================================================================
--- trunk/ippTools/src/regtool.c	(revision 8012)
+++ trunk/ippTools/src/regtool.c	(revision 8013)
@@ -63,4 +63,6 @@
         return false;
     }
+
+    psFree(new);
 
     return true;
