X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=samtools.git;a=blobdiff_plain;f=bam_index.c;h=bc89b5b24b40736902d191c5e06774c8e8f228b6;hp=3574cbc230aeee9c06e88791e2db7ee16e27e438;hb=b47984262ac098c6d3d258297602a982a34a95be;hpb=84fd13beed19b8300e1cc7dd75e931f04e9581e9 diff --git a/bam_index.c b/bam_index.c index 3574cbc..bc89b5b 100644 --- a/bam_index.c +++ b/bam_index.c @@ -521,10 +521,7 @@ static void download_from_remote(const char *url) while ((l = knet_read(fp_remote, buf, buf_size)) != 0) if (fwrite(buf, 1, l, fp) < l) { fprintf(stderr, "[download_from_remote] fail to write to destination file.\n"); - free(buf); - knet_close(fp_remote); - fclose(fp); - return; + break; } free(buf); fclose(fp);