summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-09 22:00:09 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-20 12:50:19 -0700
commitee0824f24392d5ca3d5fd5f5ed8d78c0d892f7c0 (patch)
treec0b84fc41865b4619c45c7b135012532bb90ecfd /src
parent9b291044a240e5b9b031ed814e0c84e53a1c3084 (diff)
Fix file leak on malloc error in XlcDL.c:resolve_object()
File Leak: Leaked File fp at line 219 of lib/libX11/src/xlibi18n/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>
Diffstat (limited to 'src')
-rw-r--r--src/xlibi18n/XlcDL.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xlibi18n/XlcDL.c b/src/xlibi18n/XlcDL.c
index 75e193c0..79e8a2f8 100644
--- a/src/xlibi18n/XlcDL.c
+++ b/src/xlibi18n/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);
}