all repos — tint2 @ 94e2b5edb140ee774955ae517433d9f795366ee5

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Fix double free in separator
o9000 mrovi9000@gmail.com
commit

94e2b5edb140ee774955ae517433d9f795366ee5

parent

c2d6faabc72cd03d3a2664c88c0d65a32d848e2e

1 files changed, 9 insertions(+), 1 deletions(-)

jump to
M src/separator/separator.csrc/separator/separator.c

@@ -38,6 +38,14 @@ free_area(&separator->area);

free_and_null(separator); } +gpointer copy_separator(gconstpointer arg, gpointer data) +{ + Separator *old = (Separator *)arg; + Separator *copy = (Separator *)calloc(1, sizeof(Separator)); + memcpy(copy, old, sizeof(Separator)); + return copy; +} + void init_separator() { GList *to_remove = panel_config.separator_list;

@@ -72,7 +80,7 @@ return;

// panel->separator_list is now a copy of the pointer panel_config.separator_list // We make it a deep copy - panel->separator_list = g_list_copy_deep(panel_config.separator_list, NULL, NULL); + panel->separator_list = g_list_copy_deep(panel_config.separator_list, copy_separator, NULL); for (GList *l = panel->separator_list; l; l = l->next) { Separator *separator = (Separator *)l->data;