Subj : Re: Valgrind reported memory leak To : comp.programming.threads From : Christoph Bartoschek Date : Fri Jun 10 2005 09:19 am Sanket Shakyavanshi wrote: > Hi, > > I exactly dont know where to post this message. > I am experiencing memory leak but couldn't find out where the exactly > leak is? > > Here is the valgrild report. > > ==19564== 336 bytes in 14 blocks are definitely lost in loss record 221 > of 303 > at 0x1B9005F7: malloc (vg_replace_malloc.c:130) > by 0x1C7B2C97: pthread_mutex_alloc (in > /home/exports/sanket/Server/lib/libldap50.so) > by 0x1C7B32A4: ldap_init (in > /home/exports/sanket/Server/lib/libldap50.so) > by 0x1BB5318A: PSLdapConnection::connect(std::string const&, int) > (PSLdapConnection.cpp:285) > by 0x1BB515C2: PSLdapConnection::PSLdapConnection(std::string const&, > int, std::string const&, std::string const&, bool) > (PSLdapConnection.cpp:94) > by 0x819B0AF: PSESchema::load(bool) (PSESchema.cpp:307) > by 0x8091A2F: main > > It would be great if someone suggest any poniter to resolve this issue. > > Thanks in advance > Sanket S. I guess the ldap_init function calls pthread_mutex_alloc to get memory for a mutex. This mutex is obviously used in the whole libldap library. Is there a ldap_close or a similar function? Maybe you do not call this function. However this is not a threads issue, but a problem of libldap. Christoph .