diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-10-15 10:11:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:21:02 -0500 |
commit | d0ba572fabb5ede84b97d71d24d85a4869cc43ce (patch) | |
tree | 6862ef01d879fd606fa786f5450faf2a2db04705 /source4/lib | |
parent | 223701c638def03541f456dc1fa2a2056e831408 (diff) | |
download | samba-d0ba572fabb5ede84b97d71d24d85a4869cc43ce.tar.gz samba-d0ba572fabb5ede84b97d71d24d85a4869cc43ce.tar.bz2 samba-d0ba572fabb5ede84b97d71d24d85a4869cc43ce.zip |
r19289: fixed a memory leak in ldb_dn_string_compose()
(This used to be commit 669aa1424c7a931f57856af0cd4a6f6f4a60b823)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/common/ldb_dn.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index d035b0d3c2..2902309f10 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -848,7 +848,7 @@ failed: struct ldb_dn *ldb_dn_string_compose(void *mem_ctx, const struct ldb_dn *base, const char *child_fmt, ...) { - struct ldb_dn *dn; + struct ldb_dn *dn, *dn1; char *child_str; va_list ap; @@ -860,9 +860,11 @@ struct ldb_dn *ldb_dn_string_compose(void *mem_ctx, const struct ldb_dn *base, c if (child_str == NULL) return NULL; - dn = ldb_dn_compose(mem_ctx, ldb_dn_explode(mem_ctx, child_str), base); + dn1 = ldb_dn_explode(mem_ctx, child_str); + dn = ldb_dn_compose(mem_ctx, dn1, base); talloc_free(child_str); + talloc_free(dn1); return dn; } |