From 09f9d4896e697e3c947c12ff7d36f1cdee85ef52 Mon Sep 17 00:00:00 2001 From: Mikael Hallendal Date: Sat, 26 Jan 2002 22:17:35 +0000 Subject: check if re->edit != NULL before trying to unref it. Fixes a segfault when 2002-01-26 Mikael Hallendal * rule-editor.c (add_editor_clicked): check if re->edit != NULL before trying to unref it. Fixes a segfault when closing the rule editor. svn path=/trunk/; revision=15483 --- filter/ChangeLog | 6 ++++++ filter/rule-editor.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/filter/ChangeLog b/filter/ChangeLog index 76a439ced6..7e008b8d71 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,9 @@ +2002-01-26 Mikael Hallendal + + * rule-editor.c (add_editor_clicked): check if re->edit != NULL + before trying to unref it. Fixes a segfault when closing the + rule editor. + 2002-01-15 Not Zed * filter-input.c (xml_decode): If we write "" to an xml file, we diff --git a/filter/rule-editor.c b/filter/rule-editor.c index b6056b3777..63dbd7e388 100644 --- a/filter/rule-editor.c +++ b/filter/rule-editor.c @@ -253,7 +253,10 @@ add_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re) default: gnome_dialog_close (GNOME_DIALOG (dialog)); case -1: - gtk_object_unref (GTK_OBJECT (re->edit)); + if (re->edit) { + gtk_object_unref (GTK_OBJECT (re->edit)); + } + re->edit = NULL; re->dialog = NULL; -- cgit v1.2.3