1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-26 01:49:31 +03:00

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>
This commit is contained in:
Jeremy Allison
2013-02-11 10:53:15 -08:00
parent 06fb88b449
commit 1ee428d5ca
3 changed files with 18 additions and 0 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;