The branch, master has been updated
       via  e8abc36d2a8c611ecfefa9ef8e798cf2b072a432 (commit)
      from  fb03bbfa09c9df01c349f19a28c05f9bfd1cf4dc (commit)

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


- Log -----------------------------------------------------------------
commit e8abc36d2a8c611ecfefa9ef8e798cf2b072a432
Author: Volker Lendecke <v...@samba.org>
Date:   Mon Jul 27 12:36:31 2009 +0200

    Fix a valgrind error in cli_ctemp_done
    
    For performance reasons cli_smb_recv does not make copies of the buffers we
    received from the client, so both "vwv" and "bytes" vanish with
    TALLOC_FREE(subreq). I know this is a bit counter-intuitive, but I think in
    this case it's justified not to make copies.
    
    Comments?

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

Summary of changes:
 source3/libsmb/clifile.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 5ea0579..696c979 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -4098,14 +4098,16 @@ static void cli_ctemp_done(struct tevent_req *subreq)
        uint8_t *bytes = NULL;
 
        status = cli_smb_recv(subreq, 1, &wcnt, &vwv, &num_bytes, &bytes);
-       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
+               TALLOC_FREE(subreq);
                tevent_req_nterror(req, status);
                return;
        }
 
        state->fnum = SVAL(vwv+0, 0);
 
+       TALLOC_FREE(subreq);
+
        /* From W2K3, the result is just the ASCII name */
        if (num_bytes < 2) {
                tevent_req_nterror(req, NT_STATUS_DATA_ERROR);


-- 
Samba Shared Repository

Reply via email to