tevent: fix crash bug in tevent_queue_immediate_trigger()
commit87a02403ee4fcc404dc3b887a851c421660cb4d8
authorStefan Metzmacher <metze@samba.org>
Sat, 11 Jan 2014 07:58:05 +0000 (11 08:58 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 1 Apr 2014 07:05:08 +0000 (1 09:05 +0200)
tree6b0851132ed6f0968a76f705f457f3b82909f803
parente42fd53389807d8375a69a1b8c69d48007b48a19
tevent: fix crash bug in tevent_queue_immediate_trigger()

Assume we we have a queue with 2 entries (A and B with triggerA() and triggerB()).
If triggerA() removes itself tevent_queue_entry_destructor() will be called
for A, this schedules the immediate event to call triggerB().
If triggerA() then also removes B by an explicit of implizit talloc_free(),
q->list is NULL, but the immediate event is still scheduled and can't be unscheduled.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 7fe5584e2a59584431cb2ddf8a4da22bfb924454)
lib/tevent/tevent_queue.c