talloc_is_parent() is not, as one might imagine, a direct pointer lookup, or a wrapper around talloc_parent(), but instead confirms if the supplied pointer is in a parent/child relationship up to any depth.
This is quite expensive and so becomes the dominant memory operation in LDB search operations.
We need to re-evaluate if these calls can be safely omitted in some cases and if not, change talloc_is_parent(foo, parent) to talloc_parent(foo) == parent.
The suspect commit is in Samba 4.12 and later:
Author: Aaron Haslett <email@example.com>
Date: Tue Nov 27 11:07:44 2018 +1300
drepl: memory leak fix
Fixes a memory leak where schema reference attached to ldb
instance is lost before it can be freed.
Signed-off-by: Aaron Haslett <firstname.lastname@example.org>
Reviewed-by: Andrew Bartlett <email@example.com>
Reviewed-by: Garming Sam <firstname.lastname@example.org>
Autobuild-User(master): Garming Sam <email@example.com>
Autobuild-Date(master): Wed Jul 17 06:17:10 UTC 2019 on sn-devel-184
This bug was referenced in samba master:
This bug was referenced in samba v4-15-test:
This bug was referenced in samba v4-15-stable (Release samba-4.15.0rc6):
This bug was referenced in samba v4-13-test:
This bug was referenced in samba v4-14-test: