[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Mon Jun 21 08:21:46 MDT 2010


The branch, master has been updated
       via  eb3ee78... libcli/named_pipe_auth: fix error handling in _tstream_npa_connect_recv()
       via  67a24fe... libcli/named_pipe_auth: fix memory handling for temporary data
      from  e9e80a3... tldap: Fix a type-punned warning

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


- Log -----------------------------------------------------------------
commit eb3ee7801fec0e06561732aca6012f8a8b4c24ff
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jun 21 16:20:25 2010 +0200

    libcli/named_pipe_auth: fix error handling in _tstream_npa_connect_recv()
    
    metze

commit 67a24fe9333836e4d33c167ea01f2efdc005bacd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jun 21 16:13:14 2010 +0200

    libcli/named_pipe_auth: fix memory handling for temporary data
    
    In a tevent_req based function tevent_req_create() should be the first
    function! If it fails it's the only reason, why the function
    could every return NULL.
    
    And all temporary data belongs to 'state' and gets free'ed by
    tevent_req_received() in the _recv function.
    
    metze

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

Summary of changes:
 libcli/named_pipe_auth/npa_tstream.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/named_pipe_auth/npa_tstream.c b/libcli/named_pipe_auth/npa_tstream.c
index 3518584..f6ce951 100644
--- a/libcli/named_pipe_auth/npa_tstream.c
+++ b/libcli/named_pipe_auth/npa_tstream.c
@@ -73,11 +73,7 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx,
 	struct tevent_req *subreq;
 	int ret;
 	enum ndr_err_code ndr_err;
-	char *lower_case_npipe = strlower_talloc(mem_ctx, npipe);
-
-	if (!lower_case_npipe) {
-		return NULL;
-	}
+	char *lower_case_npipe;
 
 	req = tevent_req_create(mem_ctx, &state,
 				struct tstream_npa_connect_state);
@@ -87,6 +83,11 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx,
 
 	state->caller.ev = ev;
 
+	lower_case_npipe = strlower_talloc(state, npipe);
+	if (tevent_req_nomem(lower_case_npipe, req)) {
+		goto post;
+	}
+
 	state->unix_path = talloc_asprintf(state, "%s/%s",
 					   directory,
 					   lower_case_npipe);
@@ -419,6 +420,8 @@ int _tstream_npa_connect_recv(struct tevent_req *req,
 					struct tstream_npa,
 					location);
 	if (!stream) {
+		*perrno = ENOMEM;
+		tevent_req_received(req);
 		return -1;
 	}
 	ZERO_STRUCTP(npas);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list