From 213dd8c754e381fcca0bc692422189fb0a9fa9d6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 15 Jun 2013 19:54:14 +1000 Subject: [PATCH] gensec: work around nested event loops by ensuring that the gensec_security remains valid Some nested event loops cause the main context varible here to become deallocated. This ensures that cannot happen until the end of the call. Andrew Bartlett --- auth/gensec/gensec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/auth/gensec/gensec.c b/auth/gensec/gensec.c index ea62861..ad6a19d 100644 --- a/auth/gensec/gensec.c +++ b/auth/gensec/gensec.c @@ -216,9 +216,11 @@ _PUBLIC_ NTSTATUS gensec_update(struct gensec_security *gensec_security, TALLOC_ const DATA_BLOB in, DATA_BLOB *out) { NTSTATUS status; - + TALLOC_CTX *mem_ctx = talloc_new(NULL); + talloc_reference(mem_ctx, gensec_security); status = gensec_security->ops->update(gensec_security, out_mem_ctx, ev, in, out); + talloc_free(mem_ctx); if (!NT_STATUS_IS_OK(status)) { return status; } -- 1.7.11.7