channels/smartcard: Fix leak found by covscan
leaked_storage: Variable "operation" going out of scope leaks the storage it points to.
@@ -377,10 +377,12 @@ UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp)
if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*) irp))
{
+ free(operation);
WLog_ERR(TAG, "Queue_Enqueue failed!");
return ERROR_INTERNAL_ERROR;
}
+ free(operation);
return CHANNEL_RC_OK;
}
@@ -460,6 +462,7 @@ UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp)
if (!Queue_Enqueue(smartcard->CompletedIrpQueue, (void*) irp))
{
+ free(operation);
WLog_ERR(TAG, "Queue_Enqueue failed!");
return ERROR_INTERNAL_ERROR;
}
