summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/vfs.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 6d090a95de..32e3472efe 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -274,17 +274,13 @@ void vfs_remove_fsp_extension(vfs_handle_struct *handle, files_struct *fsp)
void vfs_remove_all_fsp_extensions(files_struct *fsp)
{
struct vfs_fsp_data *curr;
- struct vfs_fsp_data *prev;
+ struct vfs_fsp_data *next;
+
+ for (curr = fsp->vfs_extension; curr; curr = next) {
+
+ next = curr->next;
+ fsp->vfs_extension = next;
- for (curr = fsp->vfs_extension, prev = NULL;
- curr;
- prev = curr, curr = curr->next)
- {
- if (prev) {
- prev->next = curr->next;
- } else {
- fsp->vfs_extension = curr->next;
- }
if (curr->destroy) {
curr->destroy(EXT_DATA_AREA(curr));
}