diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-02 07:10:54 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-02 07:10:54 +0000 |
commit | 610fcef4d33db2b62e6298bdb68546a2411d03b1 (patch) | |
tree | 87f8d10448d16c8c85a2f96c7f6e936a83c24df5 /source/smbd/statcache.c | |
parent | d4743ec0be419565c805fbc5ba2680c6ad5fe36d (diff) | |
download | samba-610fcef4d33db2b62e6298bdb68546a2411d03b1.tar.gz samba-610fcef4d33db2b62e6298bdb68546a2411d03b1.tar.xz samba-610fcef4d33db2b62e6298bdb68546a2411d03b1.zip |
fixed a memory leak (calling hash_table_init twice)
Diffstat (limited to 'source/smbd/statcache.c')
-rw-r--r-- | source/smbd/statcache.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/smbd/statcache.c b/source/smbd/statcache.c index ae5dbb1ef78..e0ceddff1da 100644 --- a/source/smbd/statcache.c +++ b/source/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 */ |