From 5044128d926d20adff9496454cf238dc1989a17c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 21 Jan 2015 02:19:48 +0100 Subject: [PATCH] http_download_file - free buffer at the end --- http_intf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/http_intf.c b/http_intf.c index ea6b6a96fb..1678edb608 100644 --- a/http_intf.c +++ b/http_intf.c @@ -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; }