From 9808c66ec37d5d99f58bdb6136ae96381cb9cfc8 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 29 Jun 2018 22:34:32 +0200 Subject: Lift xkb to XORG-1.2.0 state --- nx-X11/programs/Xserver/xkb/ddxList.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'nx-X11/programs/Xserver/xkb/ddxList.c') diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c index 6023366da..e48e28da4 100644 --- a/nx-X11/programs/Xserver/xkb/ddxList.c +++ b/nx-X11/programs/Xserver/xkb/ddxList.c @@ -164,8 +164,6 @@ char tmpname[PATH_MAX]; if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) { buf = Xprintf("%s/%s.dir",XkbBaseDirectory,componentDirs[what]); in= fopen(buf,"r"); - free (buf); - buf = NULL; } if (!in) { haveDir= False; @@ -181,8 +179,6 @@ char tmpname[PATH_MAX]; if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) { buf = Xprintf("%s.dir",componentDirs[what]); in= fopen(buf,"r"); - free (buf); - buf = NULL; } if (!in) { haveDir= False; @@ -219,6 +215,13 @@ char tmpname[PATH_MAX]; return BadImplementation; } list->nFound[what]= 0; + if (buf) { + free(buf); + buf = NULL; + } + buf = malloc(PATH_MAX * sizeof(char)); + if (!buf) + return BadAlloc; while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) { unsigned flags; register unsigned int i; @@ -263,7 +266,7 @@ char tmpname[PATH_MAX]; #ifndef WIN32 if (haveDir) fclose(in); - else if ((rval=pclose(in))!=0) { + else if ((rval=Pclose(in))!=0) { if (xkbDebugFlags) ErrorF("xkbcomp returned exit code %d\n",rval); } -- cgit v1.2.3