summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-03-09 11:17:48 +0100
committerVolker Lendecke <vl@samba.org>2008-03-10 09:51:51 +0100
commitc2cd0e3c5498403086db85af44bffd20a02fcabc (patch)
treead43df3135d0bb67de31993f34fad5e817c737c6 /source3
parent0f64ce0179c97487f94f42344e6a858bcd01c577 (diff)
downloadsamba-c2cd0e3c5498403086db85af44bffd20a02fcabc.tar.gz
samba-c2cd0e3c5498403086db85af44bffd20a02fcabc.tar.bz2
samba-c2cd0e3c5498403086db85af44bffd20a02fcabc.zip
Use talloc_tos() in secrets_init
(This used to be commit 27065382d9b692b5885265c9d60ffb7ec7748c38)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/secrets.c17
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