Move talloc_enable_null_tracking() to the s3 daemons
authorVolker Lendecke <vl@samba.org>
Fri, 24 Sep 2010 16:45:52 +0000 (18:45 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 8 Oct 2010 19:11:45 +0000 (21:11 +0200)
lib/talloc/talloc.c
source3/nmbd/nmbd.c
source3/smbd/server.c
source3/winbindd/winbindd.c

index cafe4d6e7a63c20653c8e3b50e4828b4823dedb4..84947a77b00a153a7a3e5c2385d013615630c562 100644 (file)
@@ -1013,13 +1013,6 @@ _PUBLIC_ void *talloc_init(const char *fmt, ...)
        void *ptr;
        const char *name;
 
-       /*
-        * samba3 expects talloc_report_depth_cb(NULL, ...)
-        * reports all talloc'ed memory, so we need to enable
-        * null_tracking
-        */
-       talloc_enable_null_tracking();
-
        ptr = __talloc(NULL, 0);
        if (unlikely(ptr == NULL)) return NULL;
 
index 5678c8e848cf9cc37acfc6dc9a4c494acd031ae0..fcbe50842d0cfcfc56e008b4b6972734da8b7152 100644 (file)
@@ -780,9 +780,15 @@ static bool open_sockets(bool isdaemon, int port)
        POPT_COMMON_SAMBA
        { NULL }
        };
-       TALLOC_CTX *frame = talloc_stackframe(); /* Setup tos. */
+       TALLOC_CTX *frame;
        NTSTATUS status;
 
+       /*
+        * Do this before any other talloc operation
+        */
+       talloc_enable_null_tracking();
+       frame = talloc_stackframe();
+
        load_case_tables();
 
        global_nmb_port = NMB_PORT;
index 07261b1e83179ee4bc5cb87ffc04e69f9fbd3f92..106eafcccd780a0ff317c19299809c0287e163fb 100644 (file)
@@ -857,11 +857,17 @@ extern void build_options(bool screen);
        POPT_TABLEEND
        };
        struct smbd_parent_context *parent = NULL;
-       TALLOC_CTX *frame = talloc_stackframe(); /* Setup tos. */
+       TALLOC_CTX *frame;
        NTSTATUS status;
        uint64_t unique_id;
        struct rpc_srv_callbacks spoolss_cb;
 
+       /*
+        * Do this before any other talloc operation
+        */
+       talloc_enable_null_tracking();
+       frame = talloc_stackframe();
+
        /* Initialize the event context, it will panic on error */
        smbd_event_context();
 
index 0c9cdcf52e104b490f5d42d668fa5e52a9015e0d..d2344fd69628994efba9b1d08b13876ced255108 100644 (file)
@@ -1124,9 +1124,15 @@ int main(int argc, char **argv, char **envp)
        };
        poptContext pc;
        int opt;
-       TALLOC_CTX *frame = talloc_stackframe();
+       TALLOC_CTX *frame;
        NTSTATUS status;
 
+       /*
+        * Do this before any other talloc operation
+        */
+       talloc_enable_null_tracking();
+       frame = talloc_stackframe();
+
        /* glibc (?) likes to print "User defined signal 1" and exit if a
           SIGUSR[12] is received before a handler is installed */