rsaenh: Fix a memory leak (Valgrind).

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2018-11-09 14:54:59 +01:00 committed by Alexandre Julliard
parent ef86011ba4
commit 633779b472
1 changed files with 7 additions and 6 deletions

View File

@ -3628,17 +3628,18 @@ BOOL WINAPI RSAENH_CPGetHashParam(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwPa
&pCryptHash->tpPRFParams.blobSeed, pbData, *pdwDataLen); &pCryptHash->tpPRFParams.blobSeed, pbData, *pdwDataLen);
} }
if ( pbData == NULL ) { if (pCryptHash->dwState != RSAENH_HASHSTATE_FINISHED)
*pdwDataLen = pCryptHash->dwHashSize;
return TRUE;
}
if (pbData && (pCryptHash->dwState != RSAENH_HASHSTATE_FINISHED))
{ {
finalize_hash(pCryptHash); finalize_hash(pCryptHash);
pCryptHash->dwState = RSAENH_HASHSTATE_FINISHED; pCryptHash->dwState = RSAENH_HASHSTATE_FINISHED;
} }
if (!pbData)
{
*pdwDataLen = pCryptHash->dwHashSize;
return TRUE;
}
return copy_param(pbData, pdwDataLen, pCryptHash->abHashValue, return copy_param(pbData, pdwDataLen, pCryptHash->abHashValue,
pCryptHash->dwHashSize); pCryptHash->dwHashSize);