summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-05 20:59:56 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-07 14:22:41 +0200
commit9f0cbe1558ec473f0a75b662bbc123473aa0a7aa (patch)
tree64bec3a0417275807229255b075a524a3328ffec /source4
parent92282a815d2d7351b21fd734a345e1500db89068 (diff)
downloadsamba-9f0cbe1558ec473f0a75b662bbc123473aa0a7aa.tar.gz
samba-9f0cbe1558ec473f0a75b662bbc123473aa0a7aa.tar.bz2
samba-9f0cbe1558ec473f0a75b662bbc123473aa0a7aa.zip
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.
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c6
1 files 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;
}