mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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:
committed by
Peter Hutterer
parent
20cb9c923e
commit
1223340644
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user