From 97f25e8ab4b81cc7c5b9fcc297ac3ad8e34c4eff Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Fri, 17 Aug 2018 14:19:19 +0200 Subject: [PATCH] channels/smartcard: Fix leak found by covscan leaked_storage: Variable "operation" going out of scope leaks the storage it points to. --- channels/smartcard/client/smartcard_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/channels/smartcard/client/smartcard_main.c b/channels/smartcard/client/smartcard_main.c index 2a5bc8d..37a223e 100644 --- a/channels/smartcard/client/smartcard_main.c +++ b/channels/smartcard/client/smartcard_main.c @@ -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; } -- 2.7.4