From 60d2e525f55737aff94e6c55c95ecedd722a4230 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 8 Nov 2022 13:55:27 +0100 Subject: [PATCH] [channel rdpdr] Clean up IRP on processing errors --- channels/rdpdr/client/rdpdr_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 538401e07..b8155a45e 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -1390,10 +1390,16 @@ static UINT rdpdr_process_irp(rdpdrPlugin* rdpdr, wStream* s) return error; } - IFCALLRET(irp->device->IRPRequest, error, irp->device, irp); + if (irp->device->IRPRequest) + IFCALLRET(irp->device->IRPRequest, error, irp->device, irp); + else + irp->Discard(irp); - if (error) + if (error != CHANNEL_RC_OK) + { WLog_ERR(TAG, "device->IRPRequest failed with error %" PRIu32 "", error); + irp->Discard(irp); + } return error; }