mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
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>
This commit is contained in:
parent
47d0df6c10
commit
952ee5e6cb
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user