lib/audit_logging: actually create talloc
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Tue, 18 Dec 2018 15:09:19 +0000 (16:09 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 20 Dec 2018 02:19:28 +0000 (03:19 +0100)
Heal damage of 79f494e51e..

That context is being passed around and freed but is never
actually allocated on that stack.

Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/audit_logging/audit_logging.c

index 42b9313..6944da7 100644 (file)
@@ -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