From c2cd0e3c5498403086db85af44bffd20a02fcabc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 9 Mar 2008 11:17:48 +0100 Subject: Use talloc_tos() in secrets_init (This used to be commit 27065382d9b692b5885265c9d60ffb7ec7748c38) --- source3/passdb/secrets.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'source3/passdb/secrets.c') 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 -- cgit