diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-08-13 15:31:16 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-08-14 10:40:55 +0200 |
commit | d81d6afd6f0d661b836885f57ab397c1e905a90b (patch) | |
tree | ae8a17a932085170c036f14d4493e8327054ef5e | |
parent | 956678685325a79a315f4ef19c0d834fd1747e4c (diff) | |
download | samba-d81d6afd6f0d661b836885f57ab397c1e905a90b.tar.gz samba-d81d6afd6f0d661b836885f57ab397c1e905a90b.tar.bz2 samba-d81d6afd6f0d661b836885f57ab397c1e905a90b.zip |
s4:dsdb/repl: avoid reallocation of msg->elements
The index into the elements needs to match between
msg->elements and md->ctr.ctr1.array, which means we should
pre-allocate them with the same size.
Pair-Programmed-With: Björn Baumbach <bb@sernet.de>
metze
-rw-r--r-- | source4/dsdb/repl/replicated_objects.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c index 564befe2c1..cd664e3656 100644 --- a/source4/dsdb/repl/replicated_objects.c +++ b/source4/dsdb/repl/replicated_objects.c @@ -258,7 +258,7 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb, msg->num_elements = in->object.attribute_ctr.num_attributes; msg->elements = talloc_array(msg, struct ldb_message_element, - msg->num_elements); + msg->num_elements + 1); /* +1 because of the RDN attribute */ W_ERROR_HAVE_NO_MEMORY(msg->elements); md = talloc(mem_ctx, struct replPropertyMetaDataBlob); |