From 6abfe8904a1024512c0ea8bb4844e4409e8d994b Mon Sep 17 00:00:00 2001 From: Anatoliy Atanasov Date: Thu, 24 Jun 2010 20:48:07 +0300 Subject: s4:schema/schema_set.c - free LDB message diffs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Especially the "free"s after "ldb_msg_diff" are very important since the diff message is allocated on the long-living LDB context. Signed-off-by: Matthias Dieter Wallnöfer --- source4/dsdb/schema/schema_set.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4') diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c index 0e04f5b35e..b5d8ae47f5 100644 --- a/source4/dsdb/schema/schema_set.c +++ b/source4/dsdb/schema/schema_set.c @@ -140,6 +140,7 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem if (mod_msg->num_elements > 0) { ret = dsdb_replace(ldb, mod_msg, 0); } + talloc_free(mod_msg); } if (ret == LDB_ERR_OPERATIONS_ERROR || ret == LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS || ret == LDB_ERR_INVALID_DN_SYNTAX) { @@ -168,6 +169,7 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem if (mod_msg->num_elements > 0) { ret = dsdb_replace(ldb, mod_msg, 0); } + talloc_free(mod_msg); } if (ret == LDB_ERR_OPERATIONS_ERROR || ret == LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS || ret == LDB_ERR_INVALID_DN_SYNTAX) { /* We might be on a read-only DB */ -- cgit