Samba 2.0.7 memory leaks .. continued..

Teemu Junnila (QRA) Teemu.Junnila at era.ericsson.se
Thu Sep 28 10:05:51 GMT 2000


I agree with Ranjit. I would like to test the following:
---
BOOL reset_stat_cache( void )
{
  hash_clear(&stat_cache);
  return hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE, (compare_function)(strcmp));
} /* reset_stat_cache  */
---

Does anybody see any problems with this?
Is there anything else I could free before the call to hash_table_init?

Cheers!
/Teemu



-----Original Message-----
From: P Ranjit Kumar [mailto:ranjit at cup.hp.com]
Sent: den 22 september 2000 20:35
To: samba-technical at us4.samba.org
Subject: Samba 2.0.7 memory leaks .. continued..


I looked at the patch submitted by Jeremy. It looks good but I have
question.

The new reset_stat_cache function reads ..


BOOL reset_stat_cache( void )
{
     static BOOL initialised;
     if (!lp_stat_cache()) return True;

     if (!initialised) {
         initialised = True;
         return hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE,
(compare_function)(strc
mp));
     }
     hash_clear(&stat_cache);
     return True;
} /* reset_stat_cache  */


I think there is a problem with this function. For example, when the stat
cache is already initialized and this function called, it simply deletes the
existing cache and does not bother to re-allocate and initialize the cache
(!!?).

The function name seems to indicate that, its original purpose is to just
reset the cache than deleting it altogether. Is this the reason why Teemu is
seeing the profile corruptions?

- Ranjit





More information about the samba-technical mailing list