From 90b83a79e6aed4e54ac29d022adf16be6869f054 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 29 Oct 2018 23:34:10 +0100 Subject: xkb: Fix memory leak if opening file fails Author: Pauli Nieminen Date: Thu Jul 22 11:33:33 2010 +0300 xkb: Fix memory leak if opening file fails If fopen fails pointer in buf would be overwriten with a new pointer. Signed-off-by: Pauli Nieminen Reviewed-by: Peter Hutterer Backported-to-NX-by: Ulrich Sibiller --- nx-X11/programs/Xserver/xkb/ddxList.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c index e48e28da4..e751b6b24 100644 --- a/nx-X11/programs/Xserver/xkb/ddxList.c +++ b/nx-X11/programs/Xserver/xkb/ddxList.c @@ -167,6 +167,7 @@ char tmpname[PATH_MAX]; } if (!in) { haveDir= False; + free(buf); buf = Xprintf( "'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg, XkbBinDirectory,XkbBaseDirectory,componentDirs[what],(long) @@ -182,6 +183,7 @@ char tmpname[PATH_MAX]; } if (!in) { haveDir= False; + free(buf); buf = Xprintf( "xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg, componentDirs[what],(long) -- cgit v1.2.3