diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 8572f0ec13..04db896473 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2917,8 +2917,8 @@ static CURLcode ossl_win_load_store(struct Curl_easy *data, * depending on what is found. For more details see * CertGetEnhancedKeyUsage doc. */ - if(CertGetEnhancedKeyUsage(pContext, 0, NULL, &req_size)) { - if(req_size && req_size > enhkey_usage_size) { + if(CertGetEnhancedKeyUsage(pContext, 0, NULL, &req_size) && req_size) { + if(req_size > enhkey_usage_size) { void *tmp = curlx_realloc(enhkey_usage, req_size); if(!tmp) {