mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-24 23:00:05 +01:00
Don't leak default font path when appending built-ins
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
(cherry picked from commit 66539cc05d)
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
773e4890b3
commit
0fbf6f30f7
1 changed files with 11 additions and 2 deletions
|
|
@ -601,7 +601,9 @@ configFiles(XF86ConfFilesPtr fileconf)
|
|||
defaultFontPath = Xprintf("%s%s%s",
|
||||
fileconf->file_fontpath,
|
||||
*temp_path ? "," : "", temp_path);
|
||||
must_copy = FALSE;
|
||||
if (defaultFontPath != NULL) {
|
||||
must_copy = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
defaultFontPath = fileconf->file_fontpath;
|
||||
|
|
@ -617,7 +619,14 @@ configFiles(XF86ConfFilesPtr fileconf)
|
|||
!((start == temp_path || start[-1] == ',') && (!*end || *end == ','))) {
|
||||
defaultFontPath = Xprintf("%s%sbuilt-ins",
|
||||
temp_path, *temp_path ? "," : "");
|
||||
must_copy = FALSE;
|
||||
if (must_copy == TRUE) {
|
||||
if (defaultFontPath != NULL) {
|
||||
must_copy = FALSE;
|
||||
}
|
||||
} else {
|
||||
/* already made a copy of the font path */
|
||||
xfree(temp_path);
|
||||
}
|
||||
}
|
||||
/* xf86ValidateFontPath modifies its argument, but returns a copy of it. */
|
||||
temp_path = must_copy ? XNFstrdup(defaultFontPath) : defaultFontPath;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue