summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2011-03-29 17:17:40 +0300
committerTiago Vignatti <tiago.vignatti@nokia.com>2011-04-04 17:27:12 +0300
commit066dbbaafdef9777c9c7e08cf32ac127437b7bb0 (patch)
treed4ba79b569e774367f424cc70368b9e5a3f09bf5
parentaac8fb98fdd4f1100b6f48e7d35b765b99819cb9 (diff)
xkb: fix fd leak in XkbDDXListComponent
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
-rw-r--r--xkb/ddxList.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xkb/ddxList.c b/xkb/ddxList.c
index 9623cb6aa..3d301d88e 100644
--- a/xkb/ddxList.c
+++ b/xkb/ddxList.c
@@ -222,8 +222,10 @@ char tmpname[PATH_MAX];
list->nFound[what]= 0;
free(buf);
buf = malloc(PATH_MAX * sizeof(char));
- if (!buf)
+ if (!buf) {
+ fclose(in);
return BadAlloc;
+ }
while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) {
unsigned flags;
register unsigned int i;