From b1374f0cb89c13349f9602042d04844d630f2123 Mon Sep 17 00:00:00 2001 From: o9000 Date: Wed, 9 Dec 2015 22:14:54 +0100 Subject: [PATCH] execp: Fix segfault --- src/execplugin/execplugin.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/execplugin/execplugin.c b/src/execplugin/execplugin.c index 75e0634..bf15267 100644 --- a/src/execplugin/execplugin.c +++ b/src/execplugin/execplugin.c @@ -109,12 +109,17 @@ void init_execp() } if (to_remove) { - // Cut panel_config.execp_list - if (to_remove->prev) - to_remove->prev->next = NULL; - to_remove->prev = NULL; - // Remove all elements of to_remove and to_remove itself - g_list_free_full(to_remove, destroy_execp); + if (to_remove == panel_config.execp_list) { + g_list_free_full(to_remove, destroy_execp); + panel_config.execp_list = NULL; + } else { + // Cut panel_config.execp_list + if (to_remove->prev) + to_remove->prev->next = NULL; + to_remove->prev = NULL; + // Remove all elements of to_remove and to_remove itself + g_list_free_full(to_remove, destroy_execp); + } } for (GList *l = panel_config.execp_list; l; l = l->next) {