Blob Blame History Raw
From 3942edc6d48cf9946a190d6e81b5b122b90a1b72 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Wed, 15 Jan 2014 12:58:03 +0100
Subject: [ABRT PATCH 09/12] fix a double free error in abrt-applet

Closes rhbz#1053534

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/applet/applet.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/applet/applet.c b/src/applet/applet.c
index 17e1cfb..9971e04 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -890,7 +890,6 @@ static void notify_problem_list(GList *problems, int flags)
                 NOTIFY_ACTION_CALLBACK(action_ignore),
                 pi, NULL);
 
-        free(notify_body);
         notify_body = build_message(pi);
 
         pi->was_announced = true;
@@ -950,7 +949,7 @@ static void notify_problem_list(GList *problems, int flags)
                     {
                         problem_info_free(pi);
                         g_object_unref(notification);
-                        continue;
+                        goto next_problem_to_notify;
                     }
 
                     notify_notification_update(notification, _("A Problem has been Reported"), notify_body, NULL);
@@ -965,7 +964,6 @@ static void notify_problem_list(GList *problems, int flags)
                 }
             }
         }
-        free(notify_body);
 
         GError *err = NULL;
         log_debug("Showing a notification");
@@ -975,6 +973,10 @@ static void notify_problem_list(GList *problems, int flags)
             error_msg(_("Can't show notification: %s"), err->message);
             g_error_free(err);
         }
+
+next_problem_to_notify:
+        free(notify_body);
+        notify_body = NULL;
     }
 
     g_list_free(problems);
-- 
1.8.3.1