Commit 461a1172 authored by Jeremy Allison's avatar Jeremy Allison

s3: smbd: Fix memory leak in vfswrap_getwd()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13372

Signed-off-by: Andrew Walker <awalker@ixsystems.com>.
Reviewed-by: Jeremy Allison's avatarJeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme's avatarRalph Boehme <slow@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Apr  9 21:48:12 CEST 2018 on sn-devel-144
parent 5bba8c39
......@@ -2229,9 +2229,12 @@ static struct smb_filename *vfswrap_getwd(vfs_handle_struct *handle,
NULL,
NULL,
0);
if (smb_fname == NULL) {
SAFE_FREE(result);
}
/*
* sys_getwd() *always* returns malloced memory.
* We must free here to avoid leaks:
* BUG:https://bugzilla.samba.org/show_bug.cgi?id=13372
*/
SAFE_FREE(result);
return smb_fname;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment