summaryrefslogtreecommitdiff
path: root/xkb
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 15:47:58 +0300
commit45b6667b651a0a26b17f64c9e99d70784045e4bf (patch)
tree3d3fceb954e380cbf2267cc76b6edc676ac2e309 /xkb
parent0b288c8738a97cf6aa3f36aa5c05e7ac2a5cbca8 (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>
Diffstat (limited to 'xkb')
-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;