projects
/
platform
/
upstream
/
freerdp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83e966d
)
core/info: Fix leak found by covscan
author
Ondrej Holy
<oholy@redhat.com>
Fri, 17 Aug 2018 14:10:26 +0000
(16:10 +0200)
committer
Ondrej Holy
<oholy@redhat.com>
Wed, 22 Aug 2018 12:34:02 +0000
(14:34 +0200)
leaked_storage: Variable "wString" going out of scope leaks the storage it points to.
libfreerdp/core/info.c
patch
|
blob
|
history
diff --git
a/libfreerdp/core/info.c
b/libfreerdp/core/info.c
index
006585b
..
fa97f4b
100644
(file)
--- 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);