[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: memory leaks

On Tue, Nov 06, 2001 at 01:12:54PM -0500, Mark Adamson wrote:
> I'm continuing to search for memory leaks in slapd using Purify. I've
> found that the substrings searches can leak a berval that was allocated by
> UTF8SubstringsassertionNormalize(), since it UTF8normalize's the initial
> and final sub strings.  I changed the ch_free's to ber_bvfree's in a few

Right, that was my fault I guess...

> places in schema_init.c.
> Please test the new schema_init.c with substrings searches.

I've just committed some additional memory leak fixes in schema_init.c.

I wonder if caseExactIA5SubstringsMatch and caseExactIA5SubstringsFilter
should free sa_final/sa_any/sa_initial like caseExactIgnoreSubstringsMatch
and caseExactIgnoreSubstringsFilter does.

One other thing I noticed, is that certificateExactConvert(),
certificateExactMatch() and certificateExactIndexer() don't check for
NULL return from asn1_integer2str(), while certificateExactMatch() does.
I haven't checked the code that carefully, not sure if it need to be done
or not.

> Is anyone looking at memory usage optimizations?  It seems there are a lot
> of places that dup strings.

The Unicode normalization code uses realloc too match, I should fix that,
but not high on my priority. One thing I noticed was that the same string
is often normalized several times, sometimes we normalize an already
normalized string. This leads to unnecessary memory allocations. I haven't
really thought about good solutions yet.