https://bugs.openldap.org/show_bug.cgi?id=10050
--- Comment #2 from es@m-labs.hk --- I used GCC 13.
Well we do not use multithreading in our application, so for us this fix is fine. I would suggest that another way to fix this would be allocating strings and introduce new function to the API that would free the string in correct way.
Anyway, initial code is obviously not safe for use with any compiler.