mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Fix deadlock on error before HTTP download has begun
This commit is contained in:
parent
e70c64b74a
commit
42a0518ff4
@ -123,7 +123,7 @@ http_file_get(void* userdata)
|
||||
"output file at '%s' for writing (%s).",
|
||||
download->url, download->filename,
|
||||
g_strerror(errno));
|
||||
return NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
char* cert_path = prefs_get_string(PREF_TLS_CERTPATH);
|
||||
@ -185,9 +185,6 @@ http_file_get(void* userdata)
|
||||
}
|
||||
}
|
||||
|
||||
download_processes = g_slist_remove(download_processes, download);
|
||||
pthread_mutex_unlock(&lock);
|
||||
|
||||
if (download->cmd_template != NULL) {
|
||||
gchar** argv = format_call_external_argv(download->cmd_template,
|
||||
download->url,
|
||||
@ -208,6 +205,11 @@ http_file_get(void* userdata)
|
||||
free(download->cmd_template);
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
download_processes = g_slist_remove(download_processes, download);
|
||||
pthread_mutex_unlock(&lock);
|
||||
|
||||
free(download->url);
|
||||
free(download->filename);
|
||||
free(download);
|
||||
|
Loading…
x
Reference in New Issue
Block a user