Skip to content

Commit faa3807

Browse files
ockhamgitster
authored andcommitted
http.c: die if curl_*_init fails
Signed-off-by: Bernhard Reiter <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 32f5660 commit faa3807

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

http.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ static CURL *get_curl_handle(void)
300300
{
301301
CURL *result = curl_easy_init();
302302

303+
if (!result)
304+
die("curl_easy_init failed");
305+
303306
if (!curl_ssl_verify) {
304307
curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0);
305308
curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 0);
@@ -399,7 +402,8 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
399402
git_config(urlmatch_config_entry, &config);
400403
free(normalized_url);
401404

402-
curl_global_init(CURL_GLOBAL_ALL);
405+
if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK)
406+
die("curl_global_init failed");
403407

404408
http_proactive_auth = proactive_auth;
405409

0 commit comments

Comments
 (0)