[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-960-g957cc4b

Matthias Dieter Wallnöfer mdw at samba.org
Sat Oct 3 07:54:16 MDT 2009


The branch, master has been updated
       via  957cc4b8b6aa3107a4dc565aa0f1052e9a942d2e (commit)
       via  339325792023c0f486c11c5967faeea50ca20945 (commit)
       via  24422fae24744f9c9113342692db285ba1409799 (commit)
       via  cb143eafef1dae1e055454fa3a5e90183e6c4f5d (commit)
      from  70e1d816b3dea24e260673d258f859678eb732e1 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 957cc4b8b6aa3107a4dc565aa0f1052e9a942d2e
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sat Oct 3 15:37:25 2009 +0200

    s4:ldb_tdb - fix memory leaks

commit 339325792023c0f486c11c5967faeea50ca20945
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sat Oct 3 15:36:44 2009 +0200

    heimdal kerberos - fix memory leak (free the plugin list always - not only in error cases)

commit 24422fae24744f9c9113342692db285ba1409799
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sat Oct 3 15:08:19 2009 +0200

    s4:objectclass - Free unused memory from responses

commit cb143eafef1dae1e055454fa3a5e90183e6c4f5d
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sat Oct 3 15:08:00 2009 +0200

    s4:schema_inferiors - Fix wrong check

-----------------------------------------------------------------------

Summary of changes:
 source4/dsdb/samdb/ldb_modules/objectclass.c |    3 +++
 source4/dsdb/schema/schema_inferiors.c       |    2 +-
 source4/heimdal/kdc/windc.c                  |    2 +-
 source4/lib/ldb/ldb_tdb/ldb_tdb.c            |   19 ++++++++++++-------
 4 files changed, 17 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index 51a1ac8..b6f1a1a 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -881,6 +881,8 @@ static int oc_modify_callback(struct ldb_request *req, struct ldb_reply *ares)
 					LDB_ERR_OPERATIONS_ERROR);
 	}
 
+	talloc_free(ares);
+
 	ret = ldb_build_search_req(&search_req, ldb, ac,
 				   ac->req->op.mod.message->dn, LDB_SCOPE_BASE,
 				   "(objectClass=*)",
@@ -1089,6 +1091,7 @@ static int objectclass_rename_callback(struct ldb_request *req, struct ldb_reply
 					ares->response, ares->error);
 	}
 
+	talloc_free(ares);
 
 	/* the ac->search_res should contain the new parents objectGUID */
 	parent_guid = ldb_msg_find_ldb_val(ac->search_res->message, "objectGUID");
diff --git a/source4/dsdb/schema/schema_inferiors.c b/source4/dsdb/schema/schema_inferiors.c
index 264e471..3be97b6 100644
--- a/source4/dsdb/schema/schema_inferiors.c
+++ b/source4/dsdb/schema/schema_inferiors.c
@@ -207,7 +207,7 @@ static void schema_fill_system_possible_inferiors(struct dsdb_schema *schema, st
 		if (c2->objectClassCategory != 2
 		    && c2->objectClassCategory != 3
 		    && str_list_check(superiors, schema_class->lDAPDisplayName)) {
-			if (schema_class->possibleInferiors == NULL) {
+			if (schema_class->systemPossibleInferiors == NULL) {
 				schema_class->systemPossibleInferiors = str_list_make_empty(schema_class);
 			}
 			schema_class->systemPossibleInferiors = str_list_add_const(schema_class->systemPossibleInferiors,
diff --git a/source4/heimdal/kdc/windc.c b/source4/heimdal/kdc/windc.c
index 9d7fa52..ab844e3 100644
--- a/source4/heimdal/kdc/windc.c
+++ b/source4/heimdal/kdc/windc.c
@@ -61,8 +61,8 @@ krb5_kdc_windc_init(krb5_context context)
 	(*windcft->init)(context, &windcctx);
 	break;
     }
+    _krb5_plugin_free(list);
     if (e == NULL) {
-	_krb5_plugin_free(list);
 	krb5_set_error_message(context, ENOENT, "Did not find any WINDC plugin");
 	windcft = NULL;
 	return ENOENT;
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 7427b98..0820895 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -601,11 +601,13 @@ int ltdb_modify_internal(struct ldb_module *module,
 
 	msg2 = talloc(tdb_key.dptr, struct ldb_message);
 	if (msg2 == NULL) {
+		free(tdb_data.dptr);
 		talloc_free(tdb_key.dptr);
 		return LDB_ERR_OTHER;
 	}
 
 	ret = ltdb_unpack_data(module, &tdb_data, msg2);
+	free(tdb_data.dptr);
 	if (ret == -1) {
 		ret = LDB_ERR_OTHER;
 		goto failed;
@@ -625,7 +627,8 @@ int ltdb_modify_internal(struct ldb_module *module,
 		if (ldb_attr_cmp(el->name, "distinguishedName") == 0) {
 			ldb_asprintf_errstring(ldb, "it is not permitted to perform a modify on distinguishedName (use rename instead): %s",
 					       ldb_dn_get_linearized(msg->dn));
-			return LDB_ERR_UNWILLING_TO_PERFORM;
+			ret = LDB_ERR_UNWILLING_TO_PERFORM;
+			goto failed;
 		}
 
 		switch (msg->elements[i].flags & LDB_FLAG_MOD_MASK) {
@@ -638,14 +641,16 @@ int ltdb_modify_internal(struct ldb_module *module,
 			if (el->num_values == 0) {
 				ldb_asprintf_errstring(ldb, "attribute %s on %s speicified, but with 0 values (illigal)", 
 						  el->name, ldb_dn_get_linearized(msg->dn));
-				return LDB_ERR_CONSTRAINT_VIOLATION;
+				ret = LDB_ERR_CONSTRAINT_VIOLATION;
+				goto failed;
 			}
 			if (idx == -1) {
 				if (a && a->flags & LDB_ATTR_FLAG_SINGLE_VALUE) {
 					if (el->num_values > 1) {
 						ldb_asprintf_errstring(ldb, "SINGLE-VALUE attribute %s on %s speicified more than once", 
 							       el->name, ldb_dn_get_linearized(msg->dn));
-						return LDB_ERR_CONSTRAINT_VIOLATION;
+						ret = LDB_ERR_CONSTRAINT_VIOLATION;
+						goto failed;
 					}
 				}
 				if (msg_add_element(ldb, msg2, el) != 0) {
@@ -659,7 +664,8 @@ int ltdb_modify_internal(struct ldb_module *module,
 			 * exists in the object, then we violoate the
 			 * single-value rule */
 			if (a && a->flags & LDB_ATTR_FLAG_SINGLE_VALUE) {
-				return LDB_ERR_CONSTRAINT_VIOLATION;
+				ret = LDB_ERR_CONSTRAINT_VIOLATION;
+				goto failed;
 			}
 
 			el2 = &msg2->elements[idx];
@@ -705,7 +711,8 @@ int ltdb_modify_internal(struct ldb_module *module,
 				if (el->num_values > 1) {
 					ldb_asprintf_errstring(ldb, "SINGLE-VALUE attribute %s on %s speicified more than once", 
 							       el->name, ldb_dn_get_linearized(msg->dn));
-					return LDB_ERR_CONSTRAINT_VIOLATION;
+					ret = LDB_ERR_CONSTRAINT_VIOLATION;
+					goto failed;
 				}
 			}
 			/* replace all elements of this attribute name with the elements
@@ -785,12 +792,10 @@ int ltdb_modify_internal(struct ldb_module *module,
 	}
 
 	talloc_free(tdb_key.dptr);
-	free(tdb_data.dptr);
 	return ret;
 
 failed:
 	talloc_free(tdb_key.dptr);
-	free(tdb_data.dptr);
 	return ret;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list