ldb:ldb_msg_add_value - fix here a wrong memory context
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 1 Dec 2010 15:19:17 +0000 (16:19 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 1 Dec 2010 15:30:08 +0000 (16:30 +0100)
A value array allocation should belong to "msg->elements" not "msg" directly

source4/lib/ldb/common/ldb_msg.c

index dfd86c6d3a894c255b3f0a5f308181cf78e7f8f8..8b51ad087cb58f1049f361b9c772e37fc6605344 100644 (file)
@@ -226,7 +226,8 @@ int ldb_msg_add_value(struct ldb_message *msg,
                }
        }
 
-       vals = talloc_realloc(msg, el->values, struct ldb_val, el->num_values+1);
+       vals = talloc_realloc(msg->elements, el->values, struct ldb_val,
+                             el->num_values+1);
        if (!vals) {
                errno = ENOMEM;
                return LDB_ERR_OPERATIONS_ERROR;