summaryrefslogtreecommitdiff
path: root/lib/tevent
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-02-01 15:27:10 +0100
committerJeremy Allison <jra@samba.org>2013-02-02 19:54:05 -0800
commite79ad7cff196fd6d9250420d83551fd3ac665b19 (patch)
treef072c1f35461505ff17c54f353ac370f4ffa42d1 /lib/tevent
parentdd9f0c9b6d4141bc3f40cec1567bfb28b572207c (diff)
downloadsamba-e79ad7cff196fd6d9250420d83551fd3ac665b19.tar.gz
samba-e79ad7cff196fd6d9250420d83551fd3ac665b19.tar.bz2
samba-e79ad7cff196fd6d9250420d83551fd3ac665b19.zip
tevent_poll: fix the usage of tevent_re_initialise()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/tevent')
-rw-r--r--lib/tevent/tevent_poll.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/tevent/tevent_poll.c b/lib/tevent/tevent_poll.c
index b8221a44ce..ac567ce702 100644
--- a/lib/tevent/tevent_poll.c
+++ b/lib/tevent/tevent_poll.c
@@ -92,6 +92,14 @@ static int poll_event_context_init(struct tevent_context *ev)
{
struct poll_event_context *poll_ev;
+ /*
+ * we might be called during tevent_re_initialise()
+ * which means we need to free our old additional_data
+ * in order to detach old fd events from the
+ * poll_ev->fresh list
+ */
+ TALLOC_FREE(ev->additional_data);
+
poll_ev = talloc_zero(ev, struct poll_event_context);
if (poll_ev == NULL) {
return -1;