]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb_tdb: Use mem_ctx and so avoid leak onto long-term memory on duplicated add.
authorAndrew Bartlett <abartlet@samba.org>
Wed, 13 Jun 2018 09:20:00 +0000 (11:20 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 15 Jun 2018 02:39:41 +0000 (04:39 +0200)
After a duplicated add a small amount of memory can be leaked onto a
long-term context.

Found by Andrej Gessel https://github.com/andiges

https://github.com/samba-team/samba/commit/e8fb45125e6a279b918694668e0d4fbddac10aee#commitcomment-29334102

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13471
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 15 04:39:41 CEST 2018 on sn-devel-144

lib/ldb/ldb_tdb/ldb_tdb.c

index 85816040ac76f1fdade38fa5acbdbbce5888faa5..51d608723e8b16f4b620f4bad2c63cd4ce0b6653 100644 (file)
@@ -626,7 +626,7 @@ static int ltdb_add_internal(struct ldb_module *module,
                        if (mem_ctx == NULL) {
                                return ldb_module_operr(module);
                        }
-                       ret2 = ltdb_search_base(module, module,
+                       ret2 = ltdb_search_base(module, mem_ctx,
                                                msg->dn, &dn2);
                        TALLOC_FREE(mem_ctx);
                        if (ret2 == LDB_SUCCESS) {