summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_req.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-17 19:53:55 +0200
committerStefan Metzmacher <metze@samba.org>2013-12-11 22:46:09 +0100
commit577afba8b3b75d8ebf8bc496802974b834a53f83 (patch)
tree9d0a5ae3bb9d7936825f9c27f3a46da285f24f36 /lib/tevent/tevent_req.c
parent646d8c26f82ce3a70b189f618979f63448658c4c (diff)
downloadsamba-577afba8b3b75d8ebf8bc496802974b834a53f83.tar.gz
tevent: cancel the timeout timer when the request is finished
As we might defer the callback with tevent_req_defer_callback() when calling tevent_req_done(), we should cancel the timeout directly. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'lib/tevent/tevent_req.c')
-rw-r--r--lib/tevent/tevent_req.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tevent/tevent_req.c b/lib/tevent/tevent_req.c
index 556d9848e13..4a3b8b1c7b7 100644
--- a/lib/tevent/tevent_req.c
+++ b/lib/tevent/tevent_req.c
@@ -109,6 +109,12 @@ static void tevent_req_finish(struct tevent_req *req,
enum tevent_req_state state,
const char *location)
{
+ /*
+ * make sure we do not timeout after
+ * the request was already finished
+ */
+ TALLOC_FREE(req->internal.timer);
+
req->internal.state = state;
_tevent_req_notify_callback(req, location);
}