From c2a3792e72cb534bafce3808c4a7b9f6948e8895 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 30 May 2010 20:46:57 +0200 Subject: s4:dsdb/samdb/ldb_modules/util.c - make sure to always free temporary data --- source4/dsdb/samdb/ldb_modules/util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/dsdb/samdb/ldb_modules') diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c index 37dc885a2d..6512b26fb1 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; } @@ -257,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; } @@ -312,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; } @@ -366,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; } @@ -681,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; @@ -760,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; } -- cgit