http_download_file - free buffer at the end

This commit is contained in:
twinaphex 2015-01-21 02:19:48 +01:00
parent 5e920393ac
commit 5044128d92

View File

@ -78,12 +78,16 @@ bool http_download_file(char *url, const char *output_dir,
f = fopen(output_path, "wb");
if (!f)
return false;
goto cleanup;
fwrite(buf, 1, len, f);
fclose(f);
cleanup:
if (buf)
free(buf);
return true;
}