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>
This commit is contained in:
parent
0b288c8738
commit
45b6667b65
|
@ -222,8 +222,10 @@ char tmpname[PATH_MAX];
|
||||||
list->nFound[what]= 0;
|
list->nFound[what]= 0;
|
||||||
free(buf);
|
free(buf);
|
||||||
buf = malloc(PATH_MAX * sizeof(char));
|
buf = malloc(PATH_MAX * sizeof(char));
|
||||||
if (!buf)
|
if (!buf) {
|
||||||
|
fclose(in);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
}
|
||||||
while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) {
|
while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) {
|
||||||
unsigned flags;
|
unsigned flags;
|
||||||
register unsigned int i;
|
register unsigned int i;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user