diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:18:44 (EST) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:18:44 (EST) |
commit | f7eccd4bb54039f94312a56b40599d7cb446951e (patch) | |
tree | 4dec467a1f7c7827dfdf306bf22944e51c7a7d3b /libopkg/opkg_download.c | |
parent | 90299e3df5c5d5eb4ae2189b11e44ec83995ca62 (diff) |
opkg: (leak fixing, day 2) lots and lots of memory leaks fixed
git-svn-id: http://opkg.googlecode.com/svn/trunk@115 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/opkg_download.c')
-rw-r--r-- | libopkg/opkg_download.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c index 1d882a1..7c64a5b 100644 --- a/libopkg/opkg_download.c +++ b/libopkg/opkg_download.c @@ -99,19 +99,26 @@ int opkg_download(opkg_conf_t *conf, const char *src, const char *dest_file_name free (userpwd); } res = curl_easy_perform (curl); - curl_easy_cleanup (curl); fclose (file); if (res) { long error_code; curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &error_code); opkg_message(conf, OPKG_ERROR, "Failed to download %s, error %d\n", src, error_code); + free(tmp_file_location); + free(src_basec); + curl_easy_cleanup (curl); return res; } + curl_easy_cleanup (curl); } else + { + free(tmp_file_location); + free(src_basec); return -1; + } err = file_move(tmp_file_location, dest_file_name); |