[Xfce4-commits] <xfdesktop:master> Fix double-free crash
Eric Koegel
noreply at xfce.org
Sat Aug 31 03:38:04 CEST 2013
Updating branch refs/heads/master
to 4acec356cb8ce03bfbed5366db3dc14ea0ce2327 (commit)
from 5407011db19c870d701978f49af8549144a4281f (commit)
commit 4acec356cb8ce03bfbed5366db3dc14ea0ce2327
Author: Eric Koegel <eric.koegel at gmail.com>
Date: Sun Aug 25 08:20:45 2013 +0300
Fix double-free crash
src/windowlist.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/windowlist.c b/src/windowlist.c
index a539fd4..1b3edd2 100644
--- a/src/windowlist.c
+++ b/src/windowlist.c
@@ -59,12 +59,14 @@ set_num_workspaces(GtkWidget *w, gpointer data)
gint nworkspaces = wnck_screen_get_workspace_count(wnck_screen);
const gchar *ws_name = wnck_workspace_get_name(wnck_screen_get_workspace(wnck_screen, nworkspaces -1));
gint num = GPOINTER_TO_INT(data);
- gchar *rm_label_short, *rm_label_long;
+ gchar *rm_label_short = NULL, *rm_label_long = NULL;
gint current_workspace = wnck_workspace_get_number(wnck_workspace);
const gchar *current_workspace_name = wnck_workspace_get_name(wnck_workspace);
g_return_if_fail(nworkspaces != num);
+ TRACE("entering");
+
if(num < nworkspaces) {
if(!ws_name || atoi(ws_name) == nworkspaces) {
rm_label_short = g_strdup_printf(_("Remove Workspace %d"), nworkspaces);
@@ -89,8 +91,11 @@ set_num_workspaces(GtkWidget *w, gpointer data)
}
}
- g_free(rm_label_short);
- g_free(rm_label_long);
+ if(rm_label_short != NULL)
+ g_free(rm_label_short);
+ if(rm_label_long != NULL)
+ g_free(rm_label_long);
+
wnck_screen_change_workspace_count(wnck_screen, num);
}
More information about the Xfce4-commits
mailing list