winscard: Use SecureZeroMemory() to clear magic fields.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
This commit is contained in:
parent
4502eb56ba
commit
c20a0dc6a4
1 changed files with 4 additions and 2 deletions
|
@ -205,7 +205,8 @@ LONG WINAPI SCardReleaseContext( SCARDCONTEXT context )
|
|||
|
||||
params.handle = handle->unix_handle;
|
||||
ret = UNIX_CALL( scard_release_context, ¶ms );
|
||||
handle->magic = 0;
|
||||
/* Ensure compiler doesn't optimize out the assignment with 0. */
|
||||
SecureZeroMemory( &handle->magic, sizeof(handle->magic) );
|
||||
free( handle );
|
||||
|
||||
TRACE( "returning %#lx\n", ret );
|
||||
|
@ -794,7 +795,8 @@ LONG WINAPI SCardDisconnect( SCARDHANDLE connect, DWORD disposition )
|
|||
params.disposition = disposition;
|
||||
if (!(ret = UNIX_CALL( scard_disconnect, ¶ms )))
|
||||
{
|
||||
handle->magic = 0;
|
||||
/* Ensure compiler doesn't optimize out the assignment with 0. */
|
||||
SecureZeroMemory( &handle->magic, sizeof(handle->magic) );
|
||||
free( handle );
|
||||
}
|
||||
TRACE( "returning %#lx\n", ret );
|
||||
|
|
Loading…
Add table
Reference in a new issue