From 4236f46b3350a8df60363d9698c2bae99dfb2c37 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 11 Apr 2024 12:49:55 +0200 Subject: [PATCH] [coverity] 1543262 Resource leak --- channels/cliprdr/server/cliprdr_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels/cliprdr/server/cliprdr_main.c b/channels/cliprdr/server/cliprdr_main.c index 9823f1719..23a433158 100644 --- a/channels/cliprdr/server/cliprdr_main.c +++ b/channels/cliprdr/server/cliprdr_main.c @@ -119,7 +119,6 @@ static UINT cliprdr_server_capabilities(CliprdrServerContext* context, const CLIPRDR_CAPABILITIES* capabilities) { size_t offset = 0; - wStream* s = NULL; WINPR_ASSERT(context); WINPR_ASSERT(capabilities); @@ -135,7 +134,7 @@ static UINT cliprdr_server_capabilities(CliprdrServerContext* context, return ERROR_INVALID_PARAMETER; } - s = cliprdr_packet_new(CB_CLIP_CAPS, 0, 4 + CB_CAPSTYPE_GENERAL_LEN); + wStream* s = cliprdr_packet_new(CB_CLIP_CAPS, 0, 4 + CB_CAPSTYPE_GENERAL_LEN); if (!s) { @@ -173,6 +172,7 @@ static UINT cliprdr_server_capabilities(CliprdrServerContext* context, if (!Stream_SafeSeek(s, cap->capabilitySetLength)) { WLog_ERR(TAG, "short stream"); + Stream_Free(s, TRUE); return ERROR_NO_DATA; } break;