[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Sun May 30 12:53:07 MDT 2010


The branch, master has been updated
       via  c2a3792... s4:dsdb/samdb/ldb_modules/util.c - make sure to always free temporary data
       via  b7270fb... s4:dsdb_module_search_dn - add code to handle NULL format string
       via  f927881... s4:dsdb/common/util.c - fix a counter variable
      from  5986569... selftest: list.remove raises ValueError rather than KeyError.

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


- Log -----------------------------------------------------------------
commit c2a3792e72cb534bafce3808c4a7b9f6948e8895
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Sun May 30 20:46:57 2010 +0200

    s4:dsdb/samdb/ldb_modules/util.c - make sure to always free temporary data

commit b7270fbc9971b6e625c15a60e6717410aec2b77a
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Sun May 30 20:46:31 2010 +0200

    s4:dsdb_module_search_dn - add code to handle NULL format string

commit f927881028303eb955566c08a940cca18e50ce99
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Sun May 30 20:45:56 2010 +0200

    s4:dsdb/common/util.c - fix a counter variable

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

Summary of changes:
 source4/dsdb/common/util.c            |    2 +-
 source4/dsdb/samdb/ldb_modules/util.c |   23 +++++++++++++++++++----
 2 files changed, 20 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 987864f..9329e61 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -3099,7 +3099,7 @@ int dsdb_find_nc_root(struct ldb_context *samdb, TALLOC_CTX *mem_ctx, struct ldb
 	int ret;
 	struct ldb_message_element *el;
 	struct ldb_result *root_res;
-	int i;
+	unsigned int i;
 	struct ldb_dn **nc_dns;
 
 	tmp_ctx = talloc_new(samdb);
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c
index c233df7..6512b26 100644
--- a/source4/dsdb/samdb/ldb_modules/util.c
+++ b/source4/dsdb/samdb/ldb_modules/util.c
@@ -47,6 +47,7 @@ int dsdb_module_search_dn(struct ldb_module *module,
 
 	res = talloc_zero(tmp_ctx, struct ldb_result);
 	if (!res) {
+		talloc_free(tmp_ctx);
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 
@@ -113,12 +114,22 @@ int dsdb_module_search(struct ldb_module *module,
 
 	tmp_ctx = talloc_new(mem_ctx);
 
-	va_start(ap, format);
-	expression = talloc_vasprintf(tmp_ctx, format, ap);
-	va_end(ap);
+	if (format) {
+		va_start(ap, format);
+		expression = talloc_vasprintf(tmp_ctx, format, ap);
+		va_end(ap);
+
+		if (!expression) {
+			talloc_free(tmp_ctx);
+			return LDB_ERR_OPERATIONS_ERROR;
+		}
+	} else {
+		expression = NULL;
+	}
 
 	res = talloc_zero(tmp_ctx, struct ldb_result);
 	if (!res) {
+		talloc_free(tmp_ctx);
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 
@@ -247,6 +258,7 @@ int dsdb_module_modify(struct ldb_module *module,
 
 	res = talloc_zero(tmp_ctx, struct ldb_result);
 	if (!res) {
+		talloc_free(tmp_ctx);
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 
@@ -302,6 +314,7 @@ int dsdb_module_rename(struct ldb_module *module,
 
 	res = talloc_zero(tmp_ctx, struct ldb_result);
 	if (!res) {
+		talloc_free(tmp_ctx);
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 
@@ -356,6 +369,7 @@ int dsdb_module_add(struct ldb_module *module,
 
 	res = talloc_zero(tmp_ctx, struct ldb_result);
 	if (!res) {
+		talloc_free(tmp_ctx);
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 
@@ -671,7 +685,7 @@ int dsdb_module_load_partition_usn(struct ldb_module *module, struct ldb_dn *dn,
 
 	p_ctrl = talloc(req, struct dsdb_control_current_partition);
 	if (p_ctrl == NULL) {
-		talloc_free(res);
+		talloc_free(tmp_ctx);
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 	p_ctrl->version = DSDB_CONTROL_CURRENT_PARTITION_VERSION;
@@ -750,6 +764,7 @@ int dsdb_module_save_partition_usn(struct ldb_module *module, struct ldb_dn *dn,
 
 	res = talloc_zero(msg, struct ldb_result);
 	if (!res) {
+		talloc_free(msg);
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list