summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-02-11 10:53:15 -0800
committerJeremy Allison <jra@samba.org>2013-02-14 10:19:38 -0800
commit1ee428d5cad6910521ce77322614183fa2c7916e (patch)
tree25201d3c7b7af896e4e7a2c79614dd4943a7b099 /lib
parent06fb88b449806d6de7ca20c73778dd6545a38cf7 (diff)
downloadsamba-1ee428d5cad6910521ce77322614183fa2c7916e.tar.gz
samba-1ee428d5cad6910521ce77322614183fa2c7916e.tar.bz2
samba-1ee428d5cad6910521ce77322614183fa2c7916e.zip
tevent: Add in the same tevent_re_initialise() fix Metze put in the tevent_poll backend.
We might be called during tevent_re_initialise() which means we need to free our old additional_data. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/tevent/tevent_epoll.c6
-rw-r--r--lib/tevent/tevent_select.c6
-rw-r--r--lib/tevent/tevent_standard.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/lib/tevent/tevent_epoll.c b/lib/tevent/tevent_epoll.c
index 5a17331da6..8696215f49 100644
--- a/lib/tevent/tevent_epoll.c
+++ b/lib/tevent/tevent_epoll.c
@@ -389,6 +389,12 @@ static int epoll_event_context_init(struct tevent_context *ev)
int ret;
struct epoll_event_context *epoll_ev;
+ /*
+ * We might be called during tevent_re_initialise()
+ * which means we need to free our old additional_data.
+ */
+ TALLOC_FREE(ev->additional_data);
+
epoll_ev = talloc_zero(ev, struct epoll_event_context);
if (!epoll_ev) return -1;
epoll_ev->ev = ev;
diff --git a/lib/tevent/tevent_select.c b/lib/tevent/tevent_select.c
index c11f0e8324..7e0c927dd9 100644
--- a/lib/tevent/tevent_select.c
+++ b/lib/tevent/tevent_select.c
@@ -47,6 +47,12 @@ static int select_event_context_init(struct tevent_context *ev)
{
struct select_event_context *select_ev;
+ /*
+ * We might be called during tevent_re_initialise()
+ * which means we need to free our old additional_data.
+ */
+ TALLOC_FREE(ev->additional_data);
+
select_ev = talloc_zero(ev, struct select_event_context);
if (!select_ev) return -1;
select_ev->ev = ev;
diff --git a/lib/tevent/tevent_standard.c b/lib/tevent/tevent_standard.c
index 1e33720f70..938b223572 100644
--- a/lib/tevent/tevent_standard.c
+++ b/lib/tevent/tevent_standard.c
@@ -348,6 +348,12 @@ static int std_event_context_init(struct tevent_context *ev)
{
struct std_event_context *std_ev;
+ /*
+ * We might be called during tevent_re_initialise()
+ * which means we need to free our old additional_data.
+ */
+ TALLOC_FREE(ev->additional_data);
+
std_ev = talloc_zero(ev, struct std_event_context);
if (!std_ev) return -1;
std_ev->ev = ev;