This leak occurs when doing ranged, indexed searches. The code calls index2prefix to get the index prefix. In the case of a matching rule search, this prefix is allocated. The function free_prefix was not being called in all cases.
Created attachment 313973 [details] diffs
Does free_prefix() deal with the passed parameter being NULL properly?
(In reply to comment #2) > Does free_prefix() deal with the passed parameter being NULL properly? Yes. static void free_prefix (char* prefix) { if (prefix == NULL || prefix == prefix_PRESENCE || prefix == prefix_EQUALITY || prefix == prefix_APPROX || prefix == prefix_SUB) { /* do nothing */ } else { slapi_ch_free( (void**)&prefix); } }
This bug can be triggered by an anonymous user. There is no easy way to mitigate this issue - either disable the index, or disallow anonymous searches.
Created attachment 314150 [details] cvs commit log - DS8.0 Reviewed by: nkinder (Thanks!) Fix Description: This leak occurs when doing ranged, indexed searches. The code calls index2prefix to get the index prefix. In the case of a matching rule search, this prefix is allocated. The function free_prefix was not being called in all cases. Platforms tested: RHEL5, Fedora 8 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
How can QE verify this? What to look for in the valgrind output?
(In reply to comment #7) > How can QE verify this? What to look for in the valgrind output? Look for a memory leak in index_range_read()
verified 8.0 RHEL4-32, RHEL4-64, RHEL5-32, RHEL5-64
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2008-0602.html
Created attachment 315150 [details] cvs commit log - HEAD