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-01 14:42:55 +1000
commit1223340644744c0b38aa85f5956eb5ab7c696517 (patch)
tree1d591e89ab8cc2db2cd440826ac5cda129f1ab35
parent20cb9c923efa4edc348eba30f956a66413a8208f (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>
-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)