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:08:37 +0000 (17:08 +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>
source3/rpc_server/srv_eventlog_nt.c

index de2bafc969939029a33c272c486b4d35eaaac698..71257dfdb55f4075c8e6618363fc5f8789be87af 100644 (file)
@@ -426,7 +426,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 ) );