]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r19312: This should fix a nasty bug with values and names being freed before the...
authorSimo Sorce <idra@samba.org>
Mon, 16 Oct 2006 02:45:18 +0000 (02:45 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:21:07 +0000 (14:21 -0500)
Seem that el is hanging out of a request, and the target is put on the final results.

Still one to catch and fix, but this seem to cure most of them
(This used to be commit bfeaa08fde805439dbda974be6fcb692957b00f1)

source4/lib/ldb/modules/ldb_map_outbound.c

index e1b207f6eb985008675155ff9b05a41e95efcbf5..02876eea552b1a97b86712e130e62ae5b9225e18 100644 (file)
@@ -202,7 +202,11 @@ static int ldb_msg_replace(struct ldb_message *msg, const struct ldb_message_ele
                }
        }
 
-       *old = *el;                     /* copy new element */
+       /* copy new element */
+       *old = *el;
+       /* and make sure we reference the contents */
+       talloc_reference(msg->elements, el->name);
+       talloc_reference(msg->elements, el->values);
 
        return 0;
 }