mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
messaging3: Fix running down a messaging_context
When you do a talloc_free(msg_ctx), existing waiters can't and don't have to clean up behind themselves properly anymore. The msg_ctx the cleanup function refers to is just gone. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Oct 24 04:01:32 CEST 2014 on sn-devel-104
This commit is contained in:
parent
c9cced0322
commit
6be7da3ee6
@ -267,7 +267,23 @@ static void messaging_recv_cb(const uint8_t *msg, size_t msg_len,
|
||||
|
||||
static int messaging_context_destructor(struct messaging_context *ctx)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
messaging_dgm_destroy();
|
||||
|
||||
for (i=0; i<ctx->num_new_waiters; i++) {
|
||||
if (ctx->new_waiters[i] != NULL) {
|
||||
tevent_req_set_cleanup_fn(ctx->new_waiters[i], NULL);
|
||||
ctx->new_waiters[i] = NULL;
|
||||
}
|
||||
}
|
||||
for (i=0; i<ctx->num_waiters; i++) {
|
||||
if (ctx->waiters[i] != NULL) {
|
||||
tevent_req_set_cleanup_fn(ctx->waiters[i], NULL);
|
||||
ctx->waiters[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user