summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-03-14 23:04:43 -0400
committerDan McGee <dan@archlinux.org>2012-03-14 22:17:37 -0500
commit952ee5e6cb8bb1849c1bceedae38744935c82fca (patch)
tree82d044b78f69c04d2a1471c0364329848ecf24e9 /lib/libalpm
parent47d0df6c101455c989887551bd0f0149a0f00de7 (diff)
downloadpacman-952ee5e6cb8bb1849c1bceedae38744935c82fca.tar.xz
dload: reset payload filename members before download
To avoid conflicts on reusing a payload after a failed download, ensure that we reset the filename hints in the payload struct prior to the download operation. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/dload.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index ee95e8a7..9d982183 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -394,6 +394,11 @@ static int curl_download_internal(struct dload_payload *payload,
CURL *curl = get_libcurl_handle(handle);
handle->pm_errno = 0;
+ /* make sure these are NULL */
+ FREE(payload->tempfile_name);
+ FREE(payload->destfile_name);
+ FREE(payload->content_disp_name);
+
payload->tempfile_openmode = "wb";
if(!payload->remote_name) {
STRDUP(payload->remote_name, get_filename(payload->fileurl),