aboutsummaryrefslogtreecommitdiffstats
path: root/engines/e_capi.c
diff options
context:
space:
mode:
authorJonas Maebe <jonas.maebe@elis.ugent.be>2013-12-08 23:04:54 +0100
committerKurt Roeckx <kurt@roeckx.be>2014-12-04 23:48:44 +0100
commite2140501fd366c5af617f9210160e383cf4b2c86 (patch)
tree5756c65ad88a1e5ce49cd1484d418c4abb7726f6 /engines/e_capi.c
parent0716f9e40507b5d3f63079f10db60bab8dbc6279 (diff)
downloadopenssl-e2140501fd366c5af617f9210160e383cf4b2c86.tar.gz
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>
Diffstat (limited to 'engines/e_capi.c')
-rw-r--r--engines/e_capi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/e_capi.c b/engines/e_capi.c
index d4221cbae3..f06d298324 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);