[coverity] 1543146 Use after free

This commit is contained in:
akallabeth 2024-04-11 10:40:56 +02:00 committed by akallabeth
parent b4fb4161d9
commit 3b04ab95d4

View File

@ -2386,7 +2386,10 @@ static LONG WINAPI PCSC_SCardGetAttrib_Internal(SCARDHANDLE hCard, DWORD dwAttrI
status = g_PCSC.pfnSCardGetAttrib(hCard, pcsc_dwAttrId, tmp, &pcsc_cbAttrLen);
if (status != SCARD_S_SUCCESS)
{
free(tmp);
tmp = NULL;
}
else
PCSC_AddMemoryBlock(hContext, tmp);
*(BYTE**)pbAttr = tmp;