mirror of
https://github.com/openssl/openssl.git
synced 2024-11-30 13:34:44 +08:00
capi_get_provname: free name on error if it was malloc'ed
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
0716f9e405
commit
e2140501fd
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user