Fix alloc test in CryptEnumProviderTypesW that failed if the alloc

succeeded.
This commit is contained in:
James Hawkins 2004-08-16 21:10:38 +00:00 committed by Alexandre Julliard
parent ddad3152a1
commit 25a6a0e08a
1 changed files with 1 additions and 1 deletions

View File

@ -1126,7 +1126,7 @@ BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved,
TRACE("(%ld, %p, %08ld, %p, %p, %p)\n", dwIndex, pdwReserved, dwFlags,
pdwProvType, pszTypeName, pcbTypeName);
strlen = *pcbTypeName / sizeof(WCHAR);
if ( pszTypeName && (str = CRYPT_Alloc(strlen)) )
if ( pszTypeName && !(str = CRYPT_Alloc(strlen)) )
CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY);
ret = CryptEnumProviderTypesA(dwIndex, pdwReserved, dwFlags, pdwProvType, str, &strlen);
if (str)