From 99f0659f67eb59d55aeee31bd16614a7ebe282a1 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 31 Jan 2006 03:20:18 +0000 Subject: r13253: More work to ensure that we don't keep data on long-term contexts. Andrew Bartlett (This used to be commit 35517573ff807339f96573e58bdec29073be9594) --- source4/dsdb/samdb/ldb_modules/kludge_acl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/dsdb') diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c index d6f7861f6b..0d0a266119 100644 --- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c +++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c @@ -199,6 +199,7 @@ static int kludge_acl_init_2(struct ldb_module *module) talloc_free(mem_ctx); return ret; } + talloc_steal(mem_ctx, res); if (res->count == 0) { talloc_free(mem_ctx); data->password_attrs = NULL; @@ -206,6 +207,7 @@ static int kludge_acl_init_2(struct ldb_module *module) } if (res->count > 1) { + talloc_free(mem_ctx); return LDB_ERR_CONSTRAINT_VIOLATION; } @@ -213,10 +215,12 @@ static int kludge_acl_init_2(struct ldb_module *module) password_attributes = ldb_msg_find_element(msg, "passwordAttribute"); if (!password_attributes) { + talloc_free(mem_ctx); return LDB_SUCCESS; } data->password_attrs = talloc_array(data, const char *, password_attributes->num_values + 1); if (!data->password_attrs) { + talloc_free(mem_ctx); return LDB_ERR_OPERATIONS_ERROR; } for (i=0; i < password_attributes->num_values; i++) { @@ -224,6 +228,7 @@ static int kludge_acl_init_2(struct ldb_module *module) talloc_steal(data->password_attrs, password_attributes->values[i].data); } data->password_attrs[i] = NULL; + talloc_free(mem_ctx); return LDB_SUCCESS; } -- cgit