mirror of
https://github.com/samba-team/samba.git
synced 2025-12-03 04:23:50 +03:00
s3: libsmbclient: Add readdirplus cleanup code on directory close.
Signed-off-by: Puran Chand <pchand@vmware.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
committed by
Jeremy Allison
parent
bf13fe0f22
commit
3fc5a79750
@@ -40,6 +40,26 @@
|
||||
* We accept the URL syntax explained in SMBC_parse_path(), above.
|
||||
*/
|
||||
|
||||
static void remove_dirplus(SMBCFILE *dir)
|
||||
{
|
||||
struct smbc_dirplus_list *d = NULL;
|
||||
|
||||
d = dir->dirplus_list;
|
||||
while (d != NULL) {
|
||||
struct smbc_dirplus_list *f = d;
|
||||
d = d->next;
|
||||
|
||||
SAFE_FREE(f->smb_finfo->short_name);
|
||||
SAFE_FREE(f->smb_finfo->name);
|
||||
SAFE_FREE(f->smb_finfo);
|
||||
SAFE_FREE(f);
|
||||
}
|
||||
|
||||
dir->dirplus_list = NULL;
|
||||
dir->dirplus_end = NULL;
|
||||
dir->dirplus_next = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_dir(SMBCFILE *dir)
|
||||
{
|
||||
@@ -930,6 +950,7 @@ SMBC_closedir_ctx(SMBCCTX *context,
|
||||
}
|
||||
|
||||
remove_dir(dir); /* Clean it up */
|
||||
remove_dirplus(dir);
|
||||
|
||||
DLIST_REMOVE(context->internal->files, dir);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user