From: Ondrej Holy Date: Fri, 17 Aug 2018 12:19:19 +0000 (+0200) Subject: channels/smartcard: Fix leak found by covscan X-Git-Tag: 2.0.0-rc4~110^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97f25e8ab4b81cc7c5b9fcc297ac3ad8e34c4eff;p=platform%2Fupstream%2Ffreerdp.git channels/smartcard: Fix leak found by covscan leaked_storage: Variable "operation" going out of scope leaks the storage it points to. --- 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; }