diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-10-12 20:17:33 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-10-27 18:52:29 +0200 |
commit | 751bab4fb2478f4ce24f0b41c3c1a1b428892c1b (patch) | |
tree | 8cf0c59bbeb5dc38206417970925ee43779290a2 /source4/dsdb/samdb | |
parent | 184c17587c49a43e45cda66c6547544c2424ae52 (diff) | |
download | samba-751bab4fb2478f4ce24f0b41c3c1a1b428892c1b.tar.gz samba-751bab4fb2478f4ce24f0b41c3c1a1b428892c1b.tar.bz2 samba-751bab4fb2478f4ce24f0b41c3c1a1b428892c1b.zip |
s4:objectclass LDB module - objectclass modify op. - remove superflous "talloc_strdup"
We are adding strings embedded in the schema structure which is basically
global and lives longer than the request - hence no duplication needed.
Reviewed-by: abartlet
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/objectclass.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index c854d30cf1..89dd6efd8a 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -985,7 +985,6 @@ static int objectclass_do_mod(struct oc_context *ac) { struct ldb_context *ldb; struct ldb_request *mod_req; - char *value; struct ldb_message_element *oc_el_entry, *oc_el_change; struct ldb_val *vals; struct ldb_message *msg; @@ -1146,13 +1145,10 @@ static int objectclass_do_mod(struct oc_context *ac) /* Move from the linked list back into an ldb msg */ for (current = sorted; current; current = current->next) { - value = talloc_strdup(msg, - current->objectclass->lDAPDisplayName); - if (value == NULL) { - talloc_free(mem_ctx); - return ldb_module_oom(ac->module); - } - ret = ldb_msg_add_string(msg, "objectClass", value); + const char *objectclass_name = current->objectclass->lDAPDisplayName; + + ret = ldb_msg_add_string(msg, "objectClass", + objectclass_name); if (ret != LDB_SUCCESS) { ldb_set_errstring(ldb, "objectclass: could not re-add sorted objectclasses!"); |