diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-08-09 22:00:09 -0700 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:28 +0200 |
commit | 7bca34528c6e693ce086cd8ddc92ede467448767 (patch) | |
tree | 3c72d1b573a53ba977c912ee1c565c359344761e /nx-X11 | |
parent | ce482d4fd8fe565810391b0ac89e4b1ac8fd7212 (diff) | |
download | nx-libs-7bca34528c6e693ce086cd8ddc92ede467448767.tar.gz nx-libs-7bca34528c6e693ce086cd8ddc92ede467448767.tar.bz2 nx-libs-7bca34528c6e693ce086cd8ddc92ede467448767.zip |
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 <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/lib/X11/XlcDL.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); } |