From 1b48764f24cf2204fb12cc4fa1381fc6bc9e14f4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 Oct 2009 11:16:30 +1100 Subject: [PATCH] s4-ldb: ensure new dn_list elements are not owned by caller --- source4/lib/ldb/ldb_tdb/ldb_index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index 606c24491cc..a04fb1a8bd2 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -1105,7 +1105,7 @@ static int ltdb_index_add1(struct ldb_module *module, const char *dn, talloc_free(list); return LDB_ERR_OPERATIONS_ERROR; } - list->dn[list->count].data = discard_const_p(unsigned char, dn); + list->dn[list->count].data = (uint8_t *)talloc_strdup(list->dn, dn); list->dn[list->count].length = strlen(dn); list->count++; -- 2.34.1