From 4186b5aa8cda93477de7ba156ce149f2441a3b4b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 18 Dec 2018 16:09:19 +0100 Subject: [PATCH] lib/audit_logging: actually create talloc Heal damage of 79f494e51e.. That context is being passed around and freed but is never actually allocated on that stack. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13737 Signed-off-by: Philipp Gesang Reviewed-by: Gary Lockyer Reviewed-by: Jeremy Allison (cherry picked from commit 5c928d7cd1d0ac994fe95892eec235b939ad2ec9) --- lib/audit_logging/audit_logging.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/audit_logging/audit_logging.c b/lib/audit_logging/audit_logging.c index 4ae18fb773b..3bb49f7cfc3 100644 --- a/lib/audit_logging/audit_logging.c +++ b/lib/audit_logging/audit_logging.c @@ -245,6 +245,12 @@ void audit_message_send( return; } + ctx = talloc_new(NULL); + if (ctx == NULL) { + DBG_ERR("Out of memory creating temporary context\n"); + return; + } + /* Need to refetch the address each time as the destination server may * have disconnected and reconnected in the interim, in which case * messages may get lost -- 2.17.1