[PATCH] Don't leak default font path when appending built-ins

Alan Coopersmith alan.coopersmith at sun.com
Tue Mar 31 11:23:24 PDT 2009


Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
---
 hw/xfree86/common/xf86Config.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index b9ab11a..39b1664 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -613,7 +613,11 @@ 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 == FALSE) {
+	    xfree(temp_path);
+	} else {
+	    must_copy = FALSE;
+	}
     }
     /* xf86ValidateFontPath modifies its argument, but returns a copy of it. */
     temp_path = must_copy ? xnfstrdup(defaultFontPath) : defaultFontPath;
-- 
1.5.6.5



More information about the xorg-devel mailing list