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>
This commit is contained in:
Pauli Nieminen 2010-07-22 11:33:33 +03:00 committed by Peter Hutterer
parent 20cb9c923e
commit 1223340644

View File

@ -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)