crypt32: Only free allocated handles.

This commit is contained in:
Juan Lang 2007-08-21 15:13:05 -07:00 committed by Alexandre Julliard
parent e52c80e53b
commit d4c318f295
1 changed files with 6 additions and 3 deletions

View File

@ -831,9 +831,12 @@ static void CSignedMsgData_CloseHandles(CSignedMsgData *msg_data)
for (i = 0; i < msg_data->info->cSignerInfo; i++) for (i = 0; i < msg_data->info->cSignerInfo; i++)
{ {
CryptDestroyKey(msg_data->signerHandles[i].key); if (msg_data->signerHandles[i].key)
CryptDestroyHash(msg_data->signerHandles[i].contentHash); CryptDestroyKey(msg_data->signerHandles[i].key);
CryptDestroyHash(msg_data->signerHandles[i].authAttrHash); if (msg_data->signerHandles[i].contentHash)
CryptDestroyHash(msg_data->signerHandles[i].contentHash);
if (msg_data->signerHandles[i].authAttrHash)
CryptDestroyHash(msg_data->signerHandles[i].authAttrHash);
} }
CryptMemFree(msg_data->signerHandles); CryptMemFree(msg_data->signerHandles);
} }