Ethereal-dev: Re: [Ethereal-dev] [PATCH] 0.10.5 segfaults when applying/saving preferences wit

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <[email protected]>
Date: Wed, 14 Jul 2004 01:06:22 -0700
On Tue, Jul 13, 2004 at 03:34:18PM +0200, Pavel Kankovsky wrote:
> Ethereal 0.10.5 (built with GTK1) crashes when a font without a bold 
> variant is selected and the preferences are applied/saved. The culprit is
> font_fetch() returning TRUE but leaving new_font_name NULL (or undefined)
> when user_font_test() fails.

I've checked in a change to make it return FALSE in that case, but to do
it as

	if (!user_font_test(font_name)) {
		g_free(font_name);
		return FALSE;
	}
	new_font_name = font_name;
	return TRUE;

so that the "user_font_test()" test is like the "if (font_name == NULL)"
test, and the "normal" path out of "font_fetch()" is the success path,
to make it a bit clearer what the failure paths are.