diff options
-rw-r--r-- | source3/smbd/server.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c index b86098f493..e0652d35c8 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1514,6 +1514,13 @@ void close_file(int fnum, BOOL normal_close) DEBUG(2,("%s %s closed file %s (numopen=%d)\n", timestring(),Connections[cnum].user,fs_p->name, Connections[cnum].num_files_open)); + + if (fs_p->name) { + string_free(&fs_p->name); + } + + /* we will catch bugs faster by zeroing this structure */ + memset(fs_p, 0, sizeof(*fs_p)); } enum {AFAIL,AREAD,AWRITE,AALL}; @@ -4949,7 +4956,6 @@ static void init_structs(void ) { Files[i].open = False; string_init(&Files[i].name,""); - } for (i=0;i<MAX_OPEN_FILES;i++) |