From 104a57b58ab44449bd015ca677a225cee4cb92cf Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 30 Sep 2013 14:16:46 +0100 Subject: [PATCH] Eo callbacks: Fix a possible issue of corrupted callback list. This happens when we delete more than one callback at the beginning of the list (i.e 2 or more) in one go. --- src/lib/eo/eo_base_class.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index 98a6a0d..a5a7c62 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -425,8 +425,6 @@ _eo_callback_remove(Private_Data *pd, Eo_Callback_Description *cb) Eo_Callback_Description *itr, *pitr = NULL; itr = pd->callbacks; - if (pd->callbacks == cb) - pd->callbacks = cb->next; for ( ; itr ; ) { @@ -439,6 +437,10 @@ _eo_callback_remove(Private_Data *pd, Eo_Callback_Description *cb) { pitr->next = titr->next; } + else + { + pd->callbacks = titr->next; + } free(titr); } else -- 2.7.4