Error in published patch to smbd/filename.c

Richard Bollinger rabollinger at home.com
Mon Nov 20 20:26:57 GMT 2000


A patch previously sent on this list included a memory leak "fix" for
smbd/filename.c which was in error.  It used a local static variable
"initialised" which was not defined before use.  The declaration should have
read "static BOOL initialised = False;".

Here is a fixed version of that patch:

*** ./smbd/filename.c.orig Thu Mar 16 17:59:44 2000
--- ./smbd/filename.c Fri Nov 17 09:15:28 2000
***************
*** 734,738 ****
   */
  BOOL reset_stat_cache( void )
  {
!   return hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE,
(compare_function)(strcmp));
  } /* reset_stat_cache  */
--- 734,746 ----
   */
  BOOL reset_stat_cache( void )
  {
!        static BOOL initialised = False;
!        if (!lp_stat_cache()) return True;
!
!        if (!initialised) {
!                initialised = True;
!                return hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE,
(compare_function)(strcmp));
!        }
!        hash_clear(&stat_cache);
!        return True;
  } /* reset_stat_cache  */


Rich Bollinger, Elliott Company





More information about the samba-technical mailing list