The parameters 'element_ctx' and 'old_el' are reversed. This incorrect ordering was introduced in commit b9c5417b523c4c53cb275c12ec84bbc849705bec.
Created attachment 17202 [details] patch for master
Is this triggering a specific bug?
I don't know, this is just something I noticed when looking at the code. But it seems like it could possibly cause some issues.
Removing embargo. If you look into it, you see that attrs[0] = attr->lDAPDisplayName; so the two variables will be identical and if not then it will go boom in talloc looking for the talloc header, which is not a security issue.
This bug was referenced in samba master: 7e2cc5eda84cc9fc7395b86e0908e88c72a320dc
This is fixed in all supported versions (Samba 4.17 and above).