xserver: Branch 'master'
Alan Coopersmith
alanc at kemper.freedesktop.org
Tue Apr 7 10:14:15 PDT 2009
hw/xfree86/common/xf86Config.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit 66539cc05d0b017b9feb4a038499907810140623
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date: Thu Mar 26 22:22:32 2009 -0700
Don't leak default font path when appending built-ins
Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 9a25c7b..7da85ea 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -597,7 +597,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;
@@ -613,7 +615,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;
More information about the xorg-commit
mailing list