aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorRadek Doulik <rodo@ximian.com>2001-08-02 18:25:36 +0800
committerRadek Doulik <rodo@src.gnome.org>2001-08-02 18:25:36 +0800
commitb2dc9932c2032a2d5c043639d947797dab33d8d4 (patch)
tree7a891aa5435ac56bb81a579d24f091fc52e3c334 /widgets
parentb0e751642f619d7830695523f187e27b953c0eec (diff)
downloadgsoc2013-evolution-b2dc9932c2032a2d5c043639d947797dab33d8d4.tar
gsoc2013-evolution-b2dc9932c2032a2d5c043639d947797dab33d8d4.tar.gz
gsoc2013-evolution-b2dc9932c2032a2d5c043639d947797dab33d8d4.tar.bz2
gsoc2013-evolution-b2dc9932c2032a2d5c043639d947797dab33d8d4.tar.lz
gsoc2013-evolution-b2dc9932c2032a2d5c043639d947797dab33d8d4.tar.xz
gsoc2013-evolution-b2dc9932c2032a2d5c043639d947797dab33d8d4.tar.zst
gsoc2013-evolution-b2dc9932c2032a2d5c043639d947797dab33d8d4.zip
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
Diffstat (limited to 'widgets')
-rw-r--r--widgets/text/e-completion-match.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/widgets/text/e-completion-match.c b/widgets/text/e-completion-match.c
index cfc7c88cd7..6e7863f887 100644
--- a/widgets/text/e-completion-match.c
+++ b/widgets/text/e-completion-match.c
@@ -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 *