Don't leak default font path when appending built-ins
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
This commit is contained in:
parent
0cfd481308
commit
66539cc05d
|
@ -597,8 +597,10 @@ configFiles(XF86ConfFilesPtr fileconf)
|
||||||
defaultFontPath = Xprintf("%s%s%s",
|
defaultFontPath = Xprintf("%s%s%s",
|
||||||
fileconf->file_fontpath,
|
fileconf->file_fontpath,
|
||||||
*temp_path ? "," : "", temp_path);
|
*temp_path ? "," : "", temp_path);
|
||||||
|
if (defaultFontPath != NULL) {
|
||||||
must_copy = FALSE;
|
must_copy = FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
defaultFontPath = fileconf->file_fontpath;
|
defaultFontPath = fileconf->file_fontpath;
|
||||||
}
|
}
|
||||||
|
@ -613,8 +615,15 @@ configFiles(XF86ConfFilesPtr fileconf)
|
||||||
!((start == temp_path || start[-1] == ',') && (!*end || *end == ','))) {
|
!((start == temp_path || start[-1] == ',') && (!*end || *end == ','))) {
|
||||||
defaultFontPath = Xprintf("%s%sbuilt-ins",
|
defaultFontPath = Xprintf("%s%sbuilt-ins",
|
||||||
temp_path, *temp_path ? "," : "");
|
temp_path, *temp_path ? "," : "");
|
||||||
|
if (must_copy == TRUE) {
|
||||||
|
if (defaultFontPath != NULL) {
|
||||||
must_copy = FALSE;
|
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. */
|
/* xf86ValidateFontPath modifies its argument, but returns a copy of it. */
|
||||||
temp_path = must_copy ? xnfstrdup(defaultFontPath) : defaultFontPath;
|
temp_path = must_copy ? xnfstrdup(defaultFontPath) : defaultFontPath;
|
||||||
defaultFontPath = xf86ValidateFontPath(temp_path);
|
defaultFontPath = xf86ValidateFontPath(temp_path);
|
||||||
|
|
Loading…
Reference in New Issue