Commit e2140501 authored by Jonas Maebe's avatar Jonas Maebe Committed by Kurt Roeckx
Browse files

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

parent 0716f9e4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);