Commit 25a6a0e0 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

Fix alloc test in CryptEnumProviderTypesW that failed if the alloc

succeeded.
parent ddad3152
...@@ -1126,7 +1126,7 @@ BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved, ...@@ -1126,7 +1126,7 @@ BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved,
TRACE("(%ld, %p, %08ld, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags, TRACE("(%ld, %p, %08ld, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags,
pdwProvType, pszTypeName, pcbTypeName); pdwProvType, pszTypeName, pcbTypeName);
strlen = *pcbTypeName / sizeof(WCHAR); strlen = *pcbTypeName / sizeof(WCHAR);
if ( pszTypeName && (str = CRYPT_Alloc(strlen)) ) if ( pszTypeName && !(str = CRYPT_Alloc(strlen)) )
CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY); CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY);
ret = CryptEnumProviderTypesA(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &strlen); ret = CryptEnumProviderTypesA(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &strlen);
if (str) if (str)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment