https://bugs.openldap.org/show_bug.cgi?id=10546
Issue ID: 10546 Summary: ldap_explode_dn result is not released in the interactive test client Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: libraries Assignee: bugs@openldap.org Reporter: 1489378385@qq.com Target Milestone: ---
URL: https://github.com/openldap/openldap/blob/8afcbe9e04f1a40f03cea51c57418b05f8...
Description:
Source revision: 8afcbe9e04f1a40f03cea51c57418b05f86e8f44
Affected file: libraries/libldap/test.c
Affected lines: 472-478
Source-level observation:
The interactive test client's E command calls ldap_explode_dn() and stores the returned NULL-terminated array in exdn. It prints the array elements and then leaves the switch case without releasing exdn.
According to ldap_get_dn(3), the result returned by ldap_explode_dn() should be released with ldap_value_free().
The only reference to the allocated array is overwritten the next time the E command is executed.
Steps to verify:
1. Build the libraries/libldap interactive test client with AddressSanitizer or LeakSanitizer enabled. 2. Start the test client. 3. Execute the E command and enter a valid DN, for example: cn=test,dc=example,dc=com 4. Repeat the E command several times. 5. Exit the client and inspect the sanitizer report or monitor its memory use.
Actual result:
Each E command allocates an exploded DN array that remains allocated until the process terminates.
Expected result:
The exploded DN array should be released after all of its elements have been printed.
Impact:
Repeated use of the E command increases the test client's memory consumption.
Validation status:
Confirmed by source review at the revision above. Runtime sanitizer validation is pending.
https://bugs.openldap.org/show_bug.cgi?id=10546
--- Comment #1 from Howard Chu hyc@openldap.org --- Nobody cares about one-shot test programs.
https://bugs.openldap.org/show_bug.cgi?id=10546
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.7.0 Keywords|needs_review | Assignee|bugs@openldap.org |hyc@openldap.org
https://bugs.openldap.org/show_bug.cgi?id=10546
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |TEST
--- Comment #2 from Howard Chu hyc@openldap.org --- Fixed in c1f7af2b100f0f1727b2a1b258d8365d94f49bf6 to shut up braindead AI
https://bugs.openldap.org/show_bug.cgi?id=10546
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- head:
• c1f7af2b by Howard Chu at 2026-07-21T17:01:21+01:00 ITS#10546 libldap/test.c: silence braindead AI complaints
RE27:
• a813b2bf by Howard Chu at 2026-07-21T17:34:12+00:00 ITS#10546 libldap/test.c: silence braindead AI complaints
https://bugs.openldap.org/show_bug.cgi?id=10546
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED Status|RESOLVED |VERIFIED