1
0
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:
Puran Chand
2018-04-06 14:17:35 -07:00
committed by Jeremy Allison
parent bf13fe0f22
commit 3fc5a79750

View File

@@ -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);