vfs_fruit: avoid dereferencing a freed object in an error case
authorRalph Boehme <slow@samba.org>
Fri, 3 Nov 2017 13:56:43 +0000 (14:56 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 3 Nov 2017 18:05:05 +0000 (19:05 +0100)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Nov  3 19:05:05 CET 2017 on sn-devel-144

source3/modules/vfs_fruit.c

index b0dd0f062bd16c9b1f044d90db09eb72abe10633..78170e7abddcaba5ba5bb3d0eef059bec6ecd5ca 100644 (file)
@@ -3776,11 +3776,11 @@ static int fruit_rmdir(struct vfs_handle_struct *handle,
                TALLOC_FREE(ad);
 
                ret = SMB_VFS_NEXT_UNLINK(handle, ad_smb_fname);
-               TALLOC_FREE(ad_smb_fname);
                if (ret != 0) {
                        DBG_ERR("Deleting [%s] failed\n",
                                smb_fname_str_dbg(ad_smb_fname));
                }
+               TALLOC_FREE(ad_smb_fname);
        }
 
 exit_rmdir: