From: Henry Amrhein Date: Sat, 22 Dec 2012 06:46:05 +0000 (-0800) Subject: removed duplicate code from download_from_remote() X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=samtools.git;a=commitdiff_plain;h=b47984262ac098c6d3d258297602a982a34a95be removed duplicate code from download_from_remote() --- 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);