svn commit: samba r18245 - in branches/SAMBA_4_0/source/lib/ldb/common: .

abartlet at samba.org abartlet at samba.org
Fri Sep 8 04:04:31 GMT 2006


Author: abartlet
Date: 2006-09-08 04:04:30 +0000 (Fri, 08 Sep 2006)
New Revision: 18245

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18245

Log:
Ensure we don't keep the rootdse record around (steal it onto the
correct memory context).

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2006-09-08 03:28:39 UTC (rev 18244)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2006-09-08 04:04:30 UTC (rev 18245)
@@ -162,12 +162,14 @@
 	tmp_ctx = talloc_new(ldb);
 	ret = ldb_search(ldb, ldb_dn_new(tmp_ctx), LDB_SCOPE_BASE, 
 			 "(objectClass=*)", attrs, &res);
-	if (ret == LDB_SUCCESS && res->count == 1) {
-		basedn = ldb_msg_find_attr_as_dn(ldb, res->msgs[0], "defaultNamingContext");
+	if (ret == LDB_SUCCESS) {
+		talloc_steal(tmp_ctx, res);
+		if (res->count == 1) {
+			basedn = ldb_msg_find_attr_as_dn(ldb, res->msgs[0], "defaultNamingContext");
+			ldb_set_opaque(ldb, "default_baseDN", basedn);
+		}
 	}
 
-	ldb_set_opaque(ldb, "default_baseDN", basedn);
-
 	talloc_free(tmp_ctx);
 	return basedn;
 }



More information about the samba-cvs mailing list