Revert "Eo: Fix deref after free."

Coverity found the issue, but it's an issue we've already fixed in the
past. I don't know how it got lost, but it seems like someone did a bad
merge. Probably when migrating to Eo2.

This reverts commit 831c20464d.
This commit is contained in:
Tom Hacohen 2014-05-16 14:30:33 +01:00
parent 831c20464d
commit 9b265b0065
1 changed files with 4 additions and 10 deletions

View File

@ -430,10 +430,11 @@ struct _Eo_Callback_Description
static void
_eo_callback_remove(Private_Data *pd, Eo_Callback_Description *cb)
{
Eo_Callback_Description *itr, *pitr, *base;
Eo_Callback_Description *itr, *pitr;
base = itr = pd->callbacks;
pitr = NULL;
itr = pitr = pd->callbacks;
if (pd->callbacks == cb)
pd->callbacks = cb->next;
for ( ; itr; )
{
@ -446,11 +447,6 @@ _eo_callback_remove(Private_Data *pd, Eo_Callback_Description *cb)
{
pitr->next = titr->next;
}
else
{
/* If pitr is NULL, it means we need to update base. */
base = titr->next;
}
free(titr);
}
else
@ -458,8 +454,6 @@ _eo_callback_remove(Private_Data *pd, Eo_Callback_Description *cb)
pitr = titr;
}
}
pd->callbacks = base;
}
/* Actually remove, doesn't care about walking list, or delete_me */