summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2010-07-22 11:33:33 +0300
committerPeter Hutterer <peter.hutterer@who-t.net>2010-09-27 09:40:50 +0200
commitb912c08ffa09ec9d7c55db7df1df622dd4b6ab64 (patch)
tree745ad90da297f330fadc26e327a819b94ebaee82
parentd4ef63f602325a9920dc1cbf64e3969dfa394d5f (diff)
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 <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 1223340644744c0b38aa85f5956eb5ab7c696517)
-rw-r--r--xkb/ddxList.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xkb/ddxList.c b/xkb/ddxList.c
index 2256424d0..39bd7397a 100644
--- a/xkb/ddxList.c
+++ b/xkb/ddxList.c
@@ -161,6 +161,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)
@@ -176,6 +177,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)