s4-dsdb: fixed valgrind error in replmd modify
authorAndrew Tridgell <tridge@samba.org>
Tue, 22 Dec 2009 01:21:02 +0000 (12:21 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 1 Jan 2010 21:16:54 +0000 (08:16 +1100)
We are using the values from a search result, so we need to steal them
onto the msg before we free the search results

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 5bf43857cc0213b520fb57ac59ef0b02468e6a9e..3c713ec4d9ea035579f2bf2048269138a68874fc 100644 (file)
@@ -1880,7 +1880,7 @@ static int replmd_modify_handle_linked_attribs(struct ldb_module *module,
                }
                ldb_msg_add_empty(old_msg, el->name, 0, &new_el);
                new_el->num_values = el->num_values;
-               new_el->values = el->values;
+               new_el->values = talloc_steal(msg->elements, el->values);
 
                /* TODO: this relises a bit too heavily on the exact
                   behaviour of ldb_msg_find_element and