diff options
author | Volker Lendecke <vl@samba.org> | 2009-05-24 22:13:07 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-05-24 22:13:07 +0200 |
commit | 5302db632660de44129d7cf48073bf52c9b27eca (patch) | |
tree | 2c10a40aba7d57bdcde8582fe74b3b68b0b61eff | |
parent | 68c5c6df0eeae16c56d0abc1b5ec275d18410224 (diff) | |
download | samba-5302db632660de44129d7cf48073bf52c9b27eca.tar.gz samba-5302db632660de44129d7cf48073bf52c9b27eca.tar.bz2 samba-5302db632660de44129d7cf48073bf52c9b27eca.zip |
TALLOC_FREE happily lives with a NULL ptr. Tim, please check!
Thanks,
Volker
-rw-r--r-- | source3/smbd/nttrans.c | 8 | ||||
-rw-r--r-- | source3/smbd/reply.c | 44 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 12 |
3 files changed, 16 insertions, 48 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index d51c9a6d67..204cdf9e31 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 c15ebbe35e..d5ee918b82 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 e907902c65..1748cfa0b8 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; } |