s3:idmap_tdb: simplify talloc usage with temp context from talloc_stackframe
authorMichael Adam <obnox@samba.org>
Mon, 26 Jan 2009 12:17:49 +0000 (13:17 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 6 Feb 2009 09:20:07 +0000 (10:20 +0100)
Michael

source3/winbindd/idmap_tdb.c

index 191691fefa5ae9c2c1fddae97a48ecc5f1603cfc..3a64979f339d7426834b355dd41beca5ab3a93ca 100644 (file)
@@ -258,14 +258,10 @@ static NTSTATUS idmap_tdb_open_db(TALLOC_CTX *memctx,
        }
 
        /* use our own context here */
-       ctx = talloc_new(memctx);
-       if (!ctx) {
-               DEBUG(0, ("Out of memory!\n"));
-               return NT_STATUS_NO_MEMORY;
-       }
+       ctx = talloc_stackframe();
 
        /* use the old database if present */
-       tdbfile = talloc_strdup(ctx, state_path("winbindd_idmap.tdb"));
+       tdbfile = state_path("winbindd_idmap.tdb");
        if (!tdbfile) {
                DEBUG(0, ("Out of memory!\n"));
                ret = NT_STATUS_NO_MEMORY;