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

Nick Schermer noreply at xfce.org
Fri Sep 9 20:06:03 CEST 2011


Updating branch refs/heads/master
         to a9b1ea487e7901e0a6e7cb18ccad9b806b685eaa (commit)
       from bd4964379eddb689b32dcc7cb32054714bf306b2 (commit)

commit a9b1ea487e7901e0a6e7cb18ccad9b806b685eaa
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).

 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 13c195c..9872153 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -1042,10 +1042,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