diff --git a/engines/e_capi.c b/engines/e_capi.c index d4221cbae3f24e6a18a38f5ea4db7815e7cc71d6..f06d298324a6f293b500e386fb07e7ad9bea20c8 100644 --- a/engines/e_capi.c +++ b/engines/e_capi.c @@ -1155,6 +1155,8 @@ static int capi_get_provname(CAPI_CTX *ctx, LPSTR *pname, DWORD *ptype, DWORD id if (!CryptEnumProviders(idx, NULL, 0, ptype, name, &len)) { err = GetLastError(); + if (sizeof(TCHAR) == sizeof(char)) + OPENSSL_free(name); if (err == ERROR_NO_MORE_ITEMS) return 2; CAPIerr(CAPI_F_CAPI_GET_PROVNAME, CAPI_R_CRYPTENUMPROVIDERS_ERROR);