https://bugs.openldap.org/show_bug.cgi?id=10349
Issue ID: 10349 Summary: Free ch_calloc-allocated memory in error paths Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: alexguo1023@gmail.com Target Milestone: ---
Created attachment 1078 --> https://bugs.openldap.org/attachment.cgi?id=1078&action=edit Free ch_calloc-allocated memory in error paths
1. In aa_operational, bv_allowed and bv_effective are allocated via ch_calloc. If ja == 0 or je == 0, these memory objects are never freed and do not escape the function, causing potential memory leak.
2. In memberof_db_init, the memory allocated by ch_calloc isn’t released on error paths, leading to another potential leak.
https://bugs.openldap.org/show_bug.cgi?id=10349
--- Comment #1 from Alex Guo alexguo1023@gmail.com --- *** Issue 10350 has been marked as a duplicate of this issue. ***
https://bugs.openldap.org/show_bug.cgi?id=10349
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.6.11 Keywords|needs_review |
https://bugs.openldap.org/show_bug.cgi?id=10349
Ondřej Kuzník ondra@mistotebe.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |IN_PROGRESS Assignee|bugs@openldap.org |ondra@mistotebe.net
--- Comment #2 from Ondřej Kuzník ondra@mistotebe.net --- Hi Alex, thanks for the report. For part 1, only je can be zero at the end of the loop, so I've prepared a slightly different patch and posted a merge request on Gitlab here: https://git.openldap.org/openldap/openldap/-/merge_requests/776
Could you check it still works for you? (If you want to post on the merge request, you might need your account confirmed, please post your account name here or on openldap-devel).