diff options
author | dmitrykos <dmitrykos@neutroncode.com> | 2017-12-10 20:40:44 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-12-12 08:02:07 +0100 |
commit | 2437dbbf12a2ec744e27823065cd09cf7ad6847e (patch) | |
tree | df9e5fbbd4891640925657e1c9aeb43fbcbf1206 | |
parent | ef5633d4b34a86f07d7a32f42c76a1f0eaa58c13 (diff) |
vtls: replaced getenv() with curl_getenv()
Fixed undefined symbol of getenv() which does not exist when compiling
for Windows 10 App (CURL_WINDOWS_APP). Replaced getenv() with
curl_getenv() which is aware of getenv() absence when CURL_WINDOWS_APP
is defined.
Closes #2171
-rw-r--r-- | lib/vtls/vtls.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 56e631771..def1d30cb 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -1260,6 +1260,7 @@ static size_t Curl_multissl_version(char *buffer, size_t size) static int multissl_init(const struct Curl_ssl *backend) { const char *env; + char *env_tmp; int i; if(Curl_ssl != &Curl_ssl_multi) @@ -1273,7 +1274,7 @@ static int multissl_init(const struct Curl_ssl *backend) if(!available_backends[0]) return 1; - env = getenv("CURL_SSL_BACKEND"); + env = env_tmp = curl_getenv("CURL_SSL_BACKEND"); #ifdef CURL_DEFAULT_SSL_BACKEND if(!env) env = CURL_DEFAULT_SSL_BACKEND; @@ -1282,6 +1283,7 @@ static int multissl_init(const struct Curl_ssl *backend) for(i = 0; available_backends[i]; i++) { if(strcasecompare(env, available_backends[i]->info.name)) { Curl_ssl = available_backends[i]; + curl_free(env_tmp); return 0; } } @@ -1289,6 +1291,7 @@ static int multissl_init(const struct Curl_ssl *backend) /* Fall back to first available backend */ Curl_ssl = available_backends[0]; + curl_free(env_tmp); return 0; } |