lib/sync: avoid unwanted unlink after download fail
In case we have a mirror failure, unlink_on_fail would remain set, causing an interrupt in a successive download attempt to be wrongly unlinked. This also fixes a memory leak in the url member, as we would allocate over the previous, unfreed URL. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This commit is contained in:
parent
952ee5e6cb
commit
f41037358a
|
@ -896,6 +896,8 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas)
|
|||
if(ret != -1) {
|
||||
break;
|
||||
}
|
||||
free(payload->fileurl);
|
||||
payload->unlink_on_fail = 0;
|
||||
}
|
||||
if(ret == -1) {
|
||||
errors++;
|
||||
|
|
Loading…
Reference in New Issue