summaryrefslogtreecommitdiffstats
path: root/source4/dsdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-12-10 09:18:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:16 -0500
commit078ae0f8970a1b24a4f15f4dcffbc91d6f64143f (patch)
tree5e9e568cc5feeff8b32d148c463681639ceb751e /source4/dsdb
parentd811ea17bb3a487b8bdcd2f9aa8dc4ba5cb2ab01 (diff)
downloadsamba-078ae0f8970a1b24a4f15f4dcffbc91d6f64143f.tar.gz
samba-078ae0f8970a1b24a4f15f4dcffbc91d6f64143f.tar.xz
samba-078ae0f8970a1b24a4f15f4dcffbc91d6f64143f.zip
r12161: Fix a memleak and do the -O1 janitor :-)
(This used to be commit 82d87d62614a33ec9d2ed20e63d80a7af64e8678)
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/samdb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index 5e2fa94722c..18e482c9d39 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -1004,7 +1004,7 @@ const struct dom_sid *samdb_domain_sid(struct ldb_context *ldb)
const char *attrs[] = { "rootDomainNamingContext", NULL };
int ret;
struct ldb_result *res = NULL;
- TALLOC_CTX *tmp_ctx = talloc_new(ldb);
+ TALLOC_CTX *tmp_ctx;
struct dom_sid *domain_sid;
const char *basedn_s;
struct ldb_dn *basedn;
@@ -1015,6 +1015,11 @@ const struct dom_sid *samdb_domain_sid(struct ldb_context *ldb)
return domain_sid;
}
+ tmp_ctx = talloc_new(ldb);
+ if (tmp_ctx == NULL) {
+ goto failed;
+ }
+
basedn = ldb_dn_explode(tmp_ctx, "");
if (basedn == NULL) {
goto failed;