From 4a7bb184280535bef6a3d061be3a11013e3b601e Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Fri, 17 Aug 2018 16:10:26 +0200 Subject: [PATCH] core/info: Fix leak found by covscan leaked_storage: Variable "wString" going out of scope leaks the storage it points to. --- libfreerdp/core/info.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c index 006585b..fa97f4b 100644 --- a/libfreerdp/core/info.c +++ b/libfreerdp/core/info.c @@ -1218,7 +1218,10 @@ static BOOL rdp_write_logon_info_v1(wStream* s, logon_info* info) len *= 2; if (len > 52) + { + free(wString); return FALSE; + } Stream_Write_UINT32(s, len); Stream_Write(s, wString, len); @@ -1233,7 +1236,10 @@ static BOOL rdp_write_logon_info_v1(wStream* s, logon_info* info) len *= 2; if (len > 512) + { + free(wString); return FALSE; + } Stream_Write_UINT32(s, len); Stream_Write(s, wString, len); -- 2.7.4