diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-24 12:42:36 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-30 18:55:00 -0800 |
commit | 8b4321a37a9fa2ad24bf87afabba6b08dcfded12 (patch) | |
tree | 19daada4c8bb8114a7559a7da7c17d6b58d345f8 | |
parent | caf9e3393d5d517ea129392d001a2c46a7c1f325 (diff) |
Plug minor memory leak in unusual path through ProcessConnectionSetup
Error: Memory leak (CWE 401)
Memory leak of pointer 'release' allocated with malloc((_len + 1))
at line 1100 of src/process.c in function 'ProcessConnectionSetup'.
'release' allocated at line 920 with malloc((_len + 1)).
release leaks when _i >= hisAuthCount at line 925
and i >= _IceAuthCount at line 973
and found != 0 at line 998
and status != 0 at line 1053
and status != 1 at line 1070
and accept_setup_now == 0 at line 1082
and i >= hisAuthCount at line 1093.
Memory leak of pointer 'vendor' allocated with malloc((_len + 1))
at line 1100 of src/process.c in function 'ProcessConnectionSetup'.
'vendor' allocated at line 919 with malloc((_len + 1)).
vendor leaks when _i >= hisAuthCount at line 925
and i >= _IceAuthCount at line 973
and found != 0 at line 998
and status != 0 at line 1053
and status != 1 at line 1070
and accept_setup_now == 0 at line 1082
and i >= hisAuthCount at line 1093.
[ This bug was found by the Parfait 0.3.7 bug checking tool.
For more information see http://labs.oracle.com/projects/parfait/ ]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | src/process.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c index 1e53ef9..2708ee8 100644 --- a/src/process.c +++ b/src/process.c @@ -1071,6 +1071,11 @@ ProcessConnectionSetup ( { accept_setup_now = 1; } + else + { + free (vendor); + free (release); + } if (authData && authDataLen > 0) free ((char *) authData); |