提交 e2140501 编写于 作者: J Jonas Maebe 提交者: Kurt Roeckx

capi_get_provname: free name on error if it was malloc'ed

Signed-off-by: NKurt Roeckx <kurt@roeckx.be>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 0716f9e4
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册