Index: src/lib/bigBed.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/bigBed.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -b -B -U 4 -r1.25 -r1.26
--- src/lib/bigBed.c	4 Jan 2010 19:12:41 -0000	1.25
+++ src/lib/bigBed.c	5 Feb 2010 19:33:43 -0000	1.26
@@ -28,11 +28,11 @@
 	bits32 start, bits32 end, int maxItems, struct lm *lm)
 /* Get data for interval.  Return list allocated out of lm.  Set maxItems to maximum
  * number of items to return, or to 0 for all items. */
 {
+struct bigBedInterval *el, *list = NULL;
 int itemCount = 0;
 bbiAttachUnzoomedCir(bbi);
-struct bigBedInterval *el, *list = NULL;
 bits32 chromId;
 struct fileOffsetSize *blockList = bbiOverlappingBlocks(bbi, bbi->unzoomedCir, 
 	chrom, start, end, &chromId);
 struct fileOffsetSize *block, *beforeGap, *afterGap;
@@ -108,10 +108,12 @@
 	blockBuf += block->size;
         }
     if (maxItems > 0 && itemCount > maxItems)
         break;
+    freez(&mergedBuf);
     }
 freeMem(uncompressBuf);
+dyStringFree(&dy);
 slFreeList(&blockList);
 slReverse(&list);
 return list;
 }

