[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1765-g5302db6

Volker Lendecke vlendec at samba.org
Sun May 24 20:13:36 GMT 2009


The branch, master has been updated
       via  5302db632660de44129d7cf48073bf52c9b27eca (commit)
      from  68c5c6df0eeae16c56d0abc1b5ec275d18410224 (commit)

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


- Log -----------------------------------------------------------------
commit 5302db632660de44129d7cf48073bf52c9b27eca
Author: Volker Lendecke <vl at samba.org>
Date:   Sun May 24 22:13:07 2009 +0200

    TALLOC_FREE happily lives with a NULL ptr. Tim, please check!
    
    Thanks,
    
    Volker

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

Summary of changes:
 source3/smbd/nttrans.c |    8 ++------
 source3/smbd/reply.c   |   44 +++++++++++---------------------------------
 source3/smbd/trans2.c  |   12 +++---------
 3 files changed, 16 insertions(+), 48 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index d51c9a6..204cdf9 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1316,12 +1316,8 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
 		goto out;
 	}
  out:
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
-	if (smb_fname_new) {
-		TALLOC_FREE(smb_fname_new);
-	}
+	TALLOC_FREE(smb_fname);
+	TALLOC_FREE(smb_fname_new);
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(3,("copy_internals: Error %s copy file %s to %s\n",
 			nt_errstr(status), oldname, newname));
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index c15ebbe..d5ee918 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1030,17 +1030,13 @@ void reply_checkpath(struct smb_request *req)
 
 	reply_outbuf(req, 0, 0);
  out:
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
+	TALLOC_FREE(smb_fname);
 	END_PROFILE(SMBcheckpath);
 	return;
 
  path_err:
 
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
+	TALLOC_FREE(smb_fname);
 
 	END_PROFILE(SMBcheckpath);
 
@@ -1164,9 +1160,7 @@ void reply_getatr(struct smb_request *req)
 	DEBUG(3,("reply_getatr: name=%s mode=%d size=%u\n", fname, mode, (unsigned int)size ) );
 
  out:
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
+	TALLOC_FREE(smb_fname);
 	END_PROFILE(SMBgetatr);
 	return;
 }
@@ -1272,9 +1266,7 @@ void reply_setatr(struct smb_request *req)
 
 	DEBUG( 3, ( "setatr name=%s mode=%d\n", fname, mode ) );
  out:
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
+	TALLOC_FREE(smb_fname);
 	END_PROFILE(SMBsetatr);
 	return;
 }
@@ -2316,9 +2308,7 @@ void reply_ctemp(struct smb_request *req)
 	DEBUG( 3, ( "reply_ctemp %s fd=%d umode=0%o\n", fsp->fsp_name,
 		    fsp->fh->fd, (unsigned int)smb_fname->st.st_mode));
  out:
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
+	TALLOC_FREE(smb_fname);
 	END_PROFILE(SMBctemp);
 	return;
 }
@@ -5246,9 +5236,7 @@ void reply_mkdir(struct smb_request *req)
 
 	DEBUG( 3, ( "mkdir %s\n", directory ) );
  out:
-	if (smb_dname) {
-		TALLOC_FREE(smb_dname);
-	}
+	TALLOC_FREE(smb_dname);
 	END_PROFILE(SMBmkdir);
 	return;
 }
@@ -5512,9 +5500,7 @@ void reply_rmdir(struct smb_request *req)
 
 	DEBUG( 3, ( "rmdir %s\n", directory ) );
  out:
-	if (smb_dname) {
-		TALLOC_FREE(smb_dname);
-	}
+	TALLOC_FREE(smb_dname);
 	END_PROFILE(SMBrmdir);
 	return;
 }
@@ -6301,12 +6287,8 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
 	}
 
  out:
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
-	if (smb_fname_new) {
-		TALLOC_FREE(smb_fname_new);
-	}
+	TALLOC_FREE(smb_fname);
+	TALLOC_FREE(smb_fname_new);
 	return status;
 }
 
@@ -6871,12 +6853,8 @@ void reply_copy(struct smb_request *req)
 	reply_outbuf(req, 1, 0);
 	SSVAL(req->outbuf,smb_vwv0,count);
  out:
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
-	if (smb_fname_new) {
-		TALLOC_FREE(smb_fname_new);
-	}
+	TALLOC_FREE(smb_fname);
+	TALLOC_FREE(smb_fname_new);
 	END_PROFILE(SMBcopy);
 	return;
 }
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index e907902..1748cfa 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4909,12 +4909,8 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
 				 nt_errstr(status), newname, oldname));
 	}
  out:
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
-	if (smb_fname_new) {
-		TALLOC_FREE(smb_fname_new);
-	}
+	TALLOC_FREE(smb_fname);
+	TALLOC_FREE(smb_fname_new);
 	return status;
 }
 
@@ -5524,9 +5520,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
 					FILE_WRITE_ATTRIBUTES);
 	}
  out:
-	if (smb_fname) {
-		TALLOC_FREE(smb_fname);
-	}
+	TALLOC_FREE(smb_fname);
 	return status;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list