[Xfce4-commits] <xfce4-panel:xfce-4.8> Applicationsmenu: Fix segfault with not-existing menu (bug #7895).

Nick Schermer noreply at xfce.org
Sat Sep 10 11:04:02 CEST 2011


Updating branch refs/heads/xfce-4.8
         to 466eb9d13590edca58ab9f6e2358085e75960c77 (commit)
       from 216efe3f4951fb8c88b07fbcdca78c4540d6a5ed (commit)

commit 466eb9d13590edca58ab9f6e2358085e75960c77
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Sep 9 20:03:26 2011 +0200

    Applicationsmenu: Fix segfault with not-existing menu (bug #7895).
    
    (cherry picked from commit a9b1ea487e7901e0a6e7cb18ccad9b806b685eaa)

 plugins/applicationsmenu/applicationsmenu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/plugins/applicationsmenu/applicationsmenu.c b/plugins/applicationsmenu/applicationsmenu.c
index df0bb5c..bf99281 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -1031,10 +1031,11 @@ applications_menu_plugin_menu (GtkWidget              *button,
       else
         {
           xfce_dialog_show_error (NULL, error, _("Failed to load the applications menu"));
-          g_error_free (error);
 
           gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
 
+          if (G_LIKELY (error != NULL))
+            g_error_free (error);
           if (G_LIKELY (menu != NULL))
             g_object_unref (G_OBJECT (menu));
 


More information about the Xfce4-commits mailing list