fix channel/smartcard: leak in Connect[AW]

smartcard_Connect[AW] leaked the reader buffer in error case.
This commit is contained in:
Bernhard Miklautz
2017-12-13 16:57:53 +01:00
parent bff9b98e67
commit 94b35cb4f7

View File

@@ -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)