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

Alan Coopersmith Alan.Coopersmith at Sun.COM
Tue Mar 31 17:25:09 PDT 2009



Peter Hutterer wrote:
> There's a code path (if defaultFontPath is NULL) where temp_path is assigned
> to an empty string (line 607). With this patch, the server would then try to
> free this string. Are there some surrounding conditions that I'm missing that
> guarantee that path isn't triggered?

must_copy is only set to FALSE before here if defaultFontPath was set to the
result of Xprintf at line 597, so the only case we should be trying to free
the empty string is if Xprintf failed - which we should check for up at 597.

> Also, I'm not a big fan of (foo == FALSE) conditions.

Okay, does the following look better?   Thanks for the review.

(Really better would be fixing xf86ValidateFontPath to not require the
 caller to make a copy that it modifies and returns and require the
 caller to keep track of freeing it, but that's not this fix.)

	-alan-



More information about the xorg-devel mailing list