avoid freed memory reading, when you call it like

2001-08-02  Radek Doulik  <rodo@ximian.com>

	* gal/e-text/e-completion-match.c (e_completion_match_set_text):
	avoid freed memory reading, when you call it like
	e_completion_match_set_text (match,
	e_completion_match_get_match_text (match), tmp);

svn path=/trunk/; revision=11571
This commit is contained in:
Radek Doulik
2001-08-02 10:25:36 +00:00
committed by Radek Doulik
parent b0e751642f
commit b2dc9932c2

View File

@ -84,10 +84,13 @@ e_completion_match_set_text (ECompletionMatch *match,
const gchar *match_text,
const gchar *menu_text)
{
gchar *to_be_freed_match_text;
gchar *to_be_freed_menu_text;
g_return_if_fail (match != NULL);
g_free (match->match_text);
g_free (match->menu_text);
to_be_freed_match_text = match->match_text;
to_be_freed_menu_text = match->menu_text;
if (match_text == NULL) {
match_text = "Unknown_Match";
@ -103,6 +106,9 @@ e_completion_match_set_text (ECompletionMatch *match,
match->match_text = g_strdup (match_text);
match->menu_text = g_strdup (menu_text);
g_free (to_be_freed_match_text);
g_free (to_be_freed_menu_text);
}
const gchar *