mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
fix channel/smartcard: leak in Connect[AW]
smartcard_Connect[AW] leaked the reader buffer in error case.
This commit is contained in:
@@ -767,17 +767,20 @@ static LONG smartcard_ConnectA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA
|
||||
if (status)
|
||||
{
|
||||
WLog_ERR(TAG, "SCardConnectA failed with error %"PRId32"", status);
|
||||
return status;
|
||||
goto out_fail;
|
||||
}
|
||||
|
||||
if ((status = smartcard_pack_connect_return(smartcard, irp->output, &ret)))
|
||||
{
|
||||
WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %"PRId32"", status);
|
||||
return status;
|
||||
goto out_fail;
|
||||
}
|
||||
|
||||
status = ret.ReturnCode;
|
||||
|
||||
out_fail:
|
||||
free(call->szReader);
|
||||
return ret.ReturnCode;
|
||||
return status;
|
||||
}
|
||||
|
||||
static LONG smartcard_ConnectW_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATION* operation)
|
||||
@@ -823,17 +826,20 @@ static LONG smartcard_ConnectW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA
|
||||
if (status)
|
||||
{
|
||||
WLog_ERR(TAG, "SCardConnectW failed with error %"PRId32"", status);
|
||||
return status;
|
||||
goto out_fail;
|
||||
}
|
||||
|
||||
if ((status = smartcard_pack_connect_return(smartcard, irp->output, &ret)))
|
||||
{
|
||||
WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %"PRId32"", status);
|
||||
return status;
|
||||
goto out_fail;
|
||||
}
|
||||
|
||||
status = ret.ReturnCode;
|
||||
|
||||
out_fail:
|
||||
free(call->szReader);
|
||||
return ret.ReturnCode;
|
||||
return status;
|
||||
}
|
||||
|
||||
static LONG smartcard_Reconnect_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATION* operation)
|
||||
|
||||
Reference in New Issue
Block a user