From 45b6667b651a0a26b17f64c9e99d70784045e4bf Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Tue, 29 Mar 2011 17:17:40 +0300 Subject: [PATCH] xkb: fix fd leak in XkbDDXListComponent Signed-off-by: Tiago Vignatti Reviewed-by: Peter Hutterer Reviewed-by: Nicolas Peninguy --- xkb/ddxList.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;