mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 06:36:22 +00:00
Fix deadlock on error before HTTP download has begun
This commit is contained in:
@@ -123,7 +123,7 @@ http_file_get(void* userdata)
|
|||||||
"output file at '%s' for writing (%s).",
|
"output file at '%s' for writing (%s).",
|
||||||
download->url, download->filename,
|
download->url, download->filename,
|
||||||
g_strerror(errno));
|
g_strerror(errno));
|
||||||
return NULL;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* cert_path = prefs_get_string(PREF_TLS_CERTPATH);
|
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) {
|
if (download->cmd_template != NULL) {
|
||||||
gchar** argv = format_call_external_argv(download->cmd_template,
|
gchar** argv = format_call_external_argv(download->cmd_template,
|
||||||
download->url,
|
download->url,
|
||||||
@@ -208,6 +205,11 @@ http_file_get(void* userdata)
|
|||||||
free(download->cmd_template);
|
free(download->cmd_template);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
|
||||||
|
download_processes = g_slist_remove(download_processes, download);
|
||||||
|
pthread_mutex_unlock(&lock);
|
||||||
|
|
||||||
free(download->url);
|
free(download->url);
|
||||||
free(download->filename);
|
free(download->filename);
|
||||||
free(download);
|
free(download);
|
||||||
|
|||||||
Reference in New Issue
Block a user