X-Git-Url: https://git.donarmstrong.com/?p=samtools.git;a=blobdiff_plain;f=bam_index.c;h=f916e0461dca145499303db8edb011e6db86f793;hp=d6b94e2413e1dab2d2dc4ce2c91e471854ddd35a;hb=2fa4cde9b8806faceffb8677440b54ca4c90b6f7;hpb=c857677f2a3af9da652dd6b5fc97249368e6e7d8 diff --git a/bam_index.c b/bam_index.c index d6b94e2..f916e04 100644 --- a/bam_index.c +++ b/bam_index.c @@ -464,6 +464,7 @@ bam_index_t *bam_index_load(const char *fn) strcat(strcpy(fnidx, fn), ".bai"); fprintf(stderr, "[bam_index_load] attempting to download the remote index file.\n"); download_from_remote(fnidx); + free(fnidx); idx = bam_index_load_local(fn); } if (idx == 0) fprintf(stderr, "[bam_index_load] fail to load BAM index.\n"); @@ -494,6 +495,7 @@ int bam_index_build2(const char *fn, const char *_fnidx) if (fpidx == 0) { fprintf(stderr, "[bam_index_build2] fail to create the index file.\n"); free(fnidx); + bam_index_destroy(idx); return -1; } bam_index_save(idx, fpidx);