summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-02 07:10:54 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-02 07:10:54 +0000
commitc39e2e6f9a9fb3ac2e21ef31eaad6d280cfc3d9e (patch)
tree8aa83e49ed4ea1cf352134bef6dfd82565eb67aa
parentf6dec4d551ba1054f9e936a973c2d9f90f84374f (diff)
downloadsamba-c39e2e6f9a9fb3ac2e21ef31eaad6d280cfc3d9e.tar.gz
samba-c39e2e6f9a9fb3ac2e21ef31eaad6d280cfc3d9e.tar.bz2
samba-c39e2e6f9a9fb3ac2e21ef31eaad6d280cfc3d9e.zip
fixed a memory leak (calling hash_table_init twice)
(This used to be commit 610fcef4d33db2b62e6298bdb68546a2411d03b1)
-rw-r--r--source3/smbd/statcache.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c
index ae5dbb1ef7..e0ceddff1d 100644
--- a/source3/smbd/statcache.c
+++ b/source3/smbd/statcache.c
@@ -239,5 +239,11 @@ BOOL stat_cache_lookup(connection_struct *conn, char *name, char *dirpath,
*/
BOOL reset_stat_cache( void )
{
- return hash_table_init( &stat_cache, INIT_STAT_CACHE_SIZE, (compare_function)(strcmp));
+ static BOOL initialised;
+ 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 */