Samba 2.0.7 memory leaks - continued.

P Ranjit Kumar ranjit at
Fri Sep 29 23:51:00 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)> trcmp));
> /* reset_stat_cache  */
> -

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

> Teers!
> Teemu

I think its preferable to use the patch from Jeremy (I think its more
efficient). Just add the hash_table_init(......) line after the hash_clear

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

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

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,
     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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ranjit Kumar Pedapati.vcf
Type: text/x-vcard
Size: 154 bytes
Desc: not available
Url :

More information about the samba-technical mailing list