1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s3:vfs_glusterfs: Fix a double free in vfs_gluster_getwd()

Found by cppcheck.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 26 09:34:40 CEST 2017 on sn-devel-144
This commit is contained in:
Andreas Schneider 2017-10-25 19:39:34 +02:00 committed by Jeremy Allison
parent 30584a278a
commit 16389bed07

View File

@ -1099,8 +1099,9 @@ static struct smb_filename *vfs_gluster_getwd(struct vfs_handle_struct *handle,
}
ret = glfs_getcwd(handle->data, cwd, PATH_MAX - 1);
if (ret == 0) {
if (ret == NULL) {
free(cwd);
return NULL;
}
smb_fname = synthetic_smb_fname(ctx,
ret,