From 066dbbaafdef9777c9c7e08cf32ac127437b7bb0 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Tue, 29 Mar 2011 17:17:40 +0300 Subject: 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; -- cgit v1.2.3