diff options
-rw-r--r-- | source3/passdb/secrets.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index 6c5375e7de..e4f1744bfd 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -51,22 +51,15 @@ static void get_rand_seed(int *new_seed) /* open up the secrets database */ bool secrets_init(void) { - TALLOC_CTX *ctx; char *fname = NULL; unsigned char dummy; if (tdb) return True; - ctx = talloc_init("secrets_init"); - if (!ctx) { - return false; - } - fname = talloc_asprintf(ctx, - "%s/secrets.tdb", - lp_private_dir()); - if (!fname) { - TALLOC_FREE(ctx); + fname = talloc_asprintf(talloc_tos(), "%s/secrets.tdb", + lp_private_dir()); + if (fname == NULL) { return false; } @@ -74,11 +67,11 @@ bool secrets_init(void) if (!tdb) { DEBUG(0,("Failed to open %s\n", fname)); - TALLOC_FREE(ctx); + TALLOC_FREE(fname); return False; } - TALLOC_FREE(ctx); + TALLOC_FREE(fname); /** * Set a reseed function for the crypto random generator |