From 8b4321a37a9fa2ad24bf87afabba6b08dcfded12 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 24 Nov 2011 12:42:36 -0800 Subject: 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 Reviewed-by: Jeremy Huddleston --- src/process.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- cgit v1.2.3