[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Mon Jun 11 09:27:05 MDT 2012


The branch, master has been updated
       via  34c24c2 s3: Fix Coverity ID 703869 Logically dead code
      from  e1a4d3c s3: Fix Coverity ID 709049 Dereference before null check

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 34c24c20c9a33200ebd910c5cf9c9e14b38f3d50
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jun 11 11:33:45 2012 +0200

    s3: Fix Coverity ID 703869 Logically dead code
    
    We "TALLOC_FREE(curr)" and assign prev=curr in the for-loop header.
    This will lead to "prev"==NULL always. In this loop, we do not need
    to correctly re-shuffle the linked list, we delete all from the
    beginning anyway.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Mon Jun 11 17:26:53 CEST 2012 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/vfs.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 6d090a9..32e3472 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));
 		}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list