r3181: shutdown the secrets db on exit so we don't constantly get talloc leak warnings
authorAndrew Tridgell <tridge@samba.org>
Mon, 25 Oct 2004 02:57:20 +0000 (02:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:04:37 +0000 (13:04 -0500)
(This used to be commit 11713da2efc6d45c5594289efa0b6c0e594e6d2e)

source4/passdb/secrets.c
source4/smbd/process_standard.c

index add3845d75dbcb499852bf12a1a5d5fa4b3398cf..d13e61223dbf5202efebba3f6cec8b1b49e724b9 100644 (file)
@@ -45,6 +45,12 @@ static void get_rand_seed(int *new_seed)
        }
 }
 
+/* close the secrets database */
+void secrets_shutdown(void)
+{
+       talloc_free(tdb);
+}
+
 /* open up the secrets database */
 BOOL secrets_init(void)
 {
index d70cfa676b01fd2dc78c06d9ab79ad00c7992b68..98810af0283fd0536f031e72955e34d1af5c22c8 100644 (file)
@@ -101,6 +101,9 @@ static void standard_terminate_connection(struct server_connection *conn, const
           which makes leak checking easier */
        init_iconv();
 
+       /* the secrets db should really hang off the connection structure */
+       secrets_shutdown();
+
        /* terminate this process */
        exit(0);
 }