eventlog: don't crash in sync_eventlog_params().
authorMichael Adam <obnox@samba.org>
Thu, 20 Nov 2008 15:31:44 +0000 (16:31 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 20 Nov 2008 16:13:31 +0000 (17:13 +0100)
When freeing the talloc ctx at the end of the routine,
it must be a talloc ctx created inside. talloc_tos() needs
to be valid after the function finishes, since callers
(may) have data attached to it.

Michael

Signed-off-by: Günther Deschner <gd@samba.org>
(cherry picked from commit 113c5d28edabdd17a2507e68aad612aa21c758f3)

source/rpc_server/srv_eventlog_nt.c

index 792f212452ad13d03f603d25676f1438ea9a5585..419f40647241a56b26dae1027c0dde5fc1122cd2 100644 (file)
@@ -427,7 +427,7 @@ static bool sync_eventlog_params( EVENTLOG_INFO *info )
        struct registry_value *value;
        WERROR wresult;
        char *elogname = info->logname;
-       TALLOC_CTX *ctx = talloc_tos();
+       TALLOC_CTX *ctx = talloc_stackframe();
        bool ret = false;
 
        DEBUG( 4, ( "sync_eventlog_params with %s\n", elogname ) );