From 9f0cbe1558ec473f0a75b662bbc123473aa0a7aa Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 5 Aug 2010 20:59:56 +0200 Subject: s4:objectclass LDB module - "add" operation - free "mem_ctx" as soon as possible We don't need to have it around until the end of the function. --- source4/dsdb/samdb/ldb_modules/objectclass.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index 44d8889dd5..a3fa39e80a 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -537,6 +537,8 @@ static int objectclass_do_add(struct oc_context *ac) } } + talloc_free(mem_ctx); + /* Retrive the message again so get_last_structural_class works */ objectclass_element = ldb_msg_find_element(msg, "objectClass"); @@ -606,7 +608,6 @@ static int objectclass_do_add(struct oc_context *ac) value = talloc_strdup(msg, objectclass->defaultObjectCategory); } if (value == NULL) { - talloc_free(mem_ctx); return ldb_oom(ldb); } ldb_msg_add_string(msg, "objectCategory", value); @@ -651,11 +652,8 @@ static int objectclass_do_add(struct oc_context *ac) samdb_msg_add_int(ldb, msg, msg, "systemFlags", systemFlags); } } - - talloc_free(mem_ctx); ret = ldb_msg_sanity_check(ldb, msg); - if (ret != LDB_SUCCESS) { return ret; } -- cgit