mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 01:41:52 -05:00
dload: remove redundant conditional
Replacing the strdup when after the first NULL check assures that we get continue with payload->remote_name defined. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This commit is contained in:
parent
f4875fab9b
commit
4c259d51f7
@ -345,9 +345,10 @@ static int curl_download_internal(struct dload_payload *payload,
|
||||
|
||||
payload->tempfile_openmode = "wb";
|
||||
if(!payload->remote_name) {
|
||||
payload->remote_name = strdup(get_filename(payload->fileurl));
|
||||
STRDUP(payload->remote_name, get_filename(payload->fileurl),
|
||||
RET_ERR(handle, ALPM_ERR_MEMORY, -1));
|
||||
}
|
||||
if(!payload->remote_name || curl_gethost(payload->fileurl, hostname, sizeof(hostname)) != 0) {
|
||||
if(curl_gethost(payload->fileurl, hostname, sizeof(hostname)) != 0) {
|
||||
_alpm_log(handle, ALPM_LOG_ERROR, _("url '%s' is invalid\n"), payload->fileurl);
|
||||
RET_ERR(handle, ALPM_ERR_SERVER_BAD_URL, -1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user