diff options
author | Nikias Bassen | 2012-02-09 17:33:44 +0100 |
---|---|---|
committer | Nikias Bassen | 2012-02-09 17:33:44 +0100 |
commit | 017a100c7a7d0a634b9481ca8ccb12cf839dd1a1 (patch) | |
tree | 5363f33834c29027479b6239fff0f0511a1e21e3 /src | |
parent | 59a35b2ccb1fd65ec2a4ec6c2f1d20880a33ab5f (diff) | |
download | idevicerestore-017a100c7a7d0a634b9481ca8ccb12cf839dd1a1.tar.gz idevicerestore-017a100c7a7d0a634b9481ca8ccb12cf839dd1a1.tar.bz2 |
download: call fclose before removing the file
Diffstat (limited to 'src')
-rw-r--r-- | src/download.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/download.c b/src/download.c index bd794b1..8fb482a 100644 --- a/src/download.c +++ b/src/download.c @@ -103,13 +103,13 @@ int download_to_file(const char* url, const char* filename) curl_easy_cleanup(handle); off_t sz = ftello(f); + fclose(f); + if ((sz == 0) || (sz == (off_t)-1)) { res = -1; remove(filename); } - fclose(f); - curl_global_cleanup(); return res; |