s4:ldap_server Don't talloc_steal (with references) in ldap_backend
authorAndrew Bartlett <abartlet@samba.org>
Fri, 14 Aug 2009 02:48:10 +0000 (12:48 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 14 Aug 2009 02:48:10 +0000 (12:48 +1000)
There may or may not be a need to take a reference to the 'name' in
the ldb_map code, but given we seal the whole msg just above here, it
makes no senst to steal the name, but not the values.

Andrew Bartlett

source4/ldap_server/ldap_backend.c

index 67cc893ff25c7cc9d6ca8d9a4384707e1e23f6fb..d479ff83b4802be88fa2002eaef5917bbdb2e0d8 100644 (file)
@@ -419,7 +419,7 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
                        ent->attributes = talloc_array(ent_r, struct ldb_message_element, ent->num_attributes);
                        NT_STATUS_HAVE_NO_MEMORY(ent->attributes);
                        for (j=0; j < ent->num_attributes; j++) {
-                               ent->attributes[j].name = talloc_steal(ent->attributes, res->msgs[i]->elements[j].name);
+                               ent->attributes[j].name = res->msgs[i]->elements[j].name;
                                ent->attributes[j].num_values = 0;
                                ent->attributes[j].values = NULL;
                                if (req->attributesonly && (res->msgs[i]->elements[j].num_values == 0)) {