mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-06 14:20:12 +01: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>
(cherry picked from commit 1223340644)
This commit is contained in:
parent
d4ef63f602
commit
b912c08ffa
1 changed files with 2 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue