diff --git a/channels/smartcard/client/smartcard_main.c b/channels/smartcard/client/smartcard_main.c index ccdb6ba4c..9564ddbaf 100644 --- a/channels/smartcard/client/smartcard_main.c +++ b/channels/smartcard/client/smartcard_main.c @@ -196,9 +196,12 @@ static void* smartcard_context_new(void* smartcard, SCARDCONTEXT hContext) WLog_ERR(TAG, "MessageQueue_New failed!"); goto fail; } - wObject* obj = MessageQueue_Object(pContext->IrpQueue); - WINPR_ASSERT(obj); - obj->fnObjectFree = smartcard_operation_queue_free; + + { + wObject* obj = MessageQueue_Object(pContext->IrpQueue); + WINPR_ASSERT(obj); + obj->fnObjectFree = smartcard_operation_queue_free; + } pContext->thread = CreateThread(NULL, 0, smartcard_context_thread, pContext, 0, NULL);