diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index d595bf58f..867a339fb 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -320,18 +320,15 @@ static UINT32 smartcard_ListReadersA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD call->mszGroups = NULL; } - if (status != SCARD_S_SUCCESS) - return status; - smartcard_trace_list_readers_return(smartcard, &ret, FALSE); status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret); - if (status != SCARD_S_SUCCESS) - return status; - if (mszReaders) SCardFreeMemory(operation->hContext, mszReaders); + if (status != SCARD_S_SUCCESS) + return status; + return ret.ReturnCode; } @@ -373,19 +370,15 @@ static UINT32 smartcard_ListReadersW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD call->mszGroups = NULL; } - if (status != SCARD_S_SUCCESS) - return status; - smartcard_trace_list_readers_return(smartcard, &ret, TRUE); - status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret); - if (status != SCARD_S_SUCCESS) - return status; - if (mszReaders) SCardFreeMemory(operation->hContext, mszReaders); + if (status != SCARD_S_SUCCESS) + return status; + return ret.ReturnCode; }