diff options
Diffstat (limited to 'source4/lib/ldb/common/ldb_explode_dn.c')
-rw-r--r-- | source4/lib/ldb/common/ldb_explode_dn.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/lib/ldb/common/ldb_explode_dn.c b/source4/lib/ldb/common/ldb_explode_dn.c index f015ce81c7..cacd9862b6 100644 --- a/source4/lib/ldb/common/ldb_explode_dn.c +++ b/source4/lib/ldb/common/ldb_explode_dn.c @@ -377,8 +377,7 @@ ldb_explode_dn(void * mem_ctx, */ /* allocate space for the normalized component */ - if ((component->component = - dest = talloc_size(component, size)) == NULL) { + if ((dest = talloc_size(component, size)) == NULL) { goto failed; } @@ -396,6 +395,9 @@ ldb_explode_dn(void * mem_ctx, dest += size; } + /* Save the just-generated string */ + component->component = dest; + ldb_debug(mem_ctx, LDB_DEBUG_TRACE, "component: [%s]\n", component->component); @@ -432,7 +434,7 @@ ldb_explode_dn(void * mem_ctx, } /* rebuild the normalized DN */ - if ((dn->dn = dest = talloc_size(dn, size)) == NULL) { + if ((dest = talloc_size(dn, size)) == NULL) { goto failed; } @@ -453,6 +455,9 @@ ldb_explode_dn(void * mem_ctx, dest += size; } + /* Save the just-generated string */ + dn->dn = dest; + ldb_debug(mem_ctx, LDB_DEBUG_TRACE, "dn: [%s]\n", dn->dn); /* we don't need the copy of the DN any more */ |