channels/smartcard: Fix leak found by covscan

leaked_storage: Variable "operation" going out of scope leaks the storage it points to.
This commit is contained in:
Ondrej Holy 2018-08-17 14:19:19 +02:00
parent 3baa716706
commit 97f25e8ab4

View File

@ -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;
}