Skip to content

Commit 772bc22

Browse files
committed
Handle null return from curl_easy_init
1 parent d65a2b5 commit 772bc22

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

osslsigncode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,10 @@ static BIO *bio_get_http_curl(long *http_code, char *url, BIO *req, char *proxy,
627627
/* Start a libcurl easy session and set options for a curl easy handle */
628628
printf("Connecting to %s\n", url);
629629
curl = curl_easy_init();
630+
if (!curl) {
631+
fprintf(stderr, "CURL initialization failed\n");
632+
return NULL; /* FAILED */
633+
}
630634
if (proxy) {
631635
res = curl_easy_setopt(curl, CURLOPT_PROXY, proxy);
632636
if (res != CURLE_OK) {

0 commit comments

Comments
 (0)