From 7bca34528c6e693ce086cd8ddc92ede467448767 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 9 Aug 2013 22:00:09 -0700 Subject: Fix file leak on malloc error in XlcDL.c:resolve_object() File Leak: Leaked File fp at line 219 of lib/libX11/nx-X11/lib/X11/XlcDL.c in function 'resolve_object'. fp initialized at line 198 with fopen [ This bug was found by the Parfait 1.2.0 bug checking tool. http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ] Signed-off-by: Alan Coopersmith Reviewed-by: Matthieu Herrb Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/XlcDL.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nx-X11/lib') diff --git a/nx-X11/lib/X11/XlcDL.c b/nx-X11/lib/X11/XlcDL.c index 75e193c05..79e8a2f8d 100644 --- a/nx-X11/lib/X11/XlcDL.c +++ b/nx-X11/lib/X11/XlcDL.c @@ -216,7 +216,8 @@ Limit the length of path to prevent stack buffer corruption. xi18n_objects_list = (XI18NObjectsList) Xrealloc(xi18n_objects_list, sizeof(XI18NObjectsListRec) * lc_len); - if (!xi18n_objects_list) return; + if (!xi18n_objects_list) + goto done; } n = parse_line(p, args, 6); @@ -244,6 +245,7 @@ Limit the length of path to prevent stack buffer corruption. lc_count++; } } + done: fclose(fp); } -- cgit v1.2.3