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

memory leaks

We opened up a new service using OpenLDAP here at CMU, and the thousands
of new connections pouring in started making the slapd process grow in
size. Thus we joined the list of sites interested in memory leaks.

We have a license to use "Purify" by Rational Inc, which does all sorts of
nifty memory checks, including watching for memory leaks as the process
exits. I relinked slapd using purify and found a few places that leak
memory. There are several that can be ignored, such as when main() does a
strdup for the -h and -f options, but there are some others that can occur
a LOT.

In caseExactIgnoreSubstringsFilter() in schema_init.c, a SubstringsAssertion
structure can be left allocated if no keys are found. Also (and this one
is actually my fault) the SASL strings that are passed from the server to
the client need to be free'd for V1.2 SASL, which I wasn't doing.  When
POSIX threads are initialized, the "attr" struct has to be free'd. And
lastly, the list of supported SASL mechanisms has to be free'd after the
root DSE is queried.

I just commit'd changes to


please test.

-Mark Adamson
 Carnegie Mellon