Fixed memory leaks in PCSC_SCardReadCache[AW]

This commit is contained in:
Armin Novak 2020-02-18 12:50:29 +01:00
parent f885476423
commit fa10dfa186
1 changed files with 6 additions and 0 deletions

View File

@ -2541,7 +2541,10 @@ static LONG WINAPI PCSC_SCardReadCacheA(SCARDCONTEXT hContext, UUID* CardIdentif
return SCARD_E_NO_MEMORY;
if (!PCSC_AddMemoryBlock(hContext, mem))
{
free(mem);
return SCARD_E_NO_MEMORY;
}
memcpy(mem, data->data, data->len);
*ppData = mem;
@ -2579,7 +2582,10 @@ static LONG WINAPI PCSC_SCardReadCacheW(SCARDCONTEXT hContext, UUID* CardIdentif
return SCARD_E_NO_MEMORY;
if (!PCSC_AddMemoryBlock(hContext, mem))
{
free(mem);
return SCARD_E_NO_MEMORY;
}
memcpy(mem, data->data, data->len);
*ppData = mem;