src/hg/lib/bamFile.c 1.14
1.14 2009/11/06 18:09:55 angie
Don't use kentlib free functions on mem returned from samtools, because kentlib functions weren't used to allocate it.
Index: src/hg/lib/bamFile.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/bamFile.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -b -B -U 4 -r1.13 -r1.14
--- src/hg/lib/bamFile.c 5 Nov 2009 17:50:24 -0000 1.13
+++ src/hg/lib/bamFile.c 6 Nov 2009 18:09:55 -0000 1.14
@@ -151,9 +151,9 @@
{
warn("bamFileExists: failed to read index corresponding to %s", bamFileName);
return FALSE;
}
- freeMem(idx);
+ free(idx); // Not freeMem, freez etc -- sam just uses malloc/calloc.
return TRUE;
}
return FALSE;
}
@@ -180,8 +180,9 @@
errAbort("bam_index_load(%s) failed.", bamFileName);
ret = bam_fetch(fh->x.bam, idx, chromId, start, end, callbackData, callbackFunc);
if (ret != 0)
errAbort("bam_fetch(%s, %s (chromId=%d) failed (%d)", bamFileName, position, chromId, ret);
+free(idx); // Not freeMem, freez etc -- sam just uses malloc/calloc.
samclose(fh);
}
boolean bamIsRc(const bam1_t *bam)