1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Fix deadlock on error before HTTP download has begun

This commit is contained in:
William Wennerström 2020-12-10 19:26:06 +01:00
parent e70c64b74a
commit 42a0518ff4
No known key found for this signature in database
GPG Key ID: E1382990BEDD319B

View File

@ -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);