[SCM] Samba Shared Repository - branch v3-devel updated - release-3-2-0pre2-4038-gbe6f122

Volker Lendecke vlendec at samba.org
Fri Sep 5 12:11:17 GMT 2008


The branch, v3-devel has been updated
       via  be6f12273f171a3eb1967d2299064e57d737f6a4 (commit)
      from  2e15036bacf717d27d1806bcbdba1e68f2f76aae (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-devel


- Log -----------------------------------------------------------------
commit be6f12273f171a3eb1967d2299064e57d737f6a4
Author: Qiao Yang <geoyang at ironport.com>
Date:   Fri Sep 5 14:08:09 2008 +0200

    Fix a memleak
    
    request.extra_data is not freed if there is no extra_data in response or
    when there is some error happens in processing. This patch will free the
    buffer right after processing a request before sending back a response.

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

Summary of changes:
 source/winbindd/winbindd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/winbindd/winbindd.c b/source/winbindd/winbindd.c
index f75af64..44b5415 100644
--- a/source/winbindd/winbindd.c
+++ b/source/winbindd/winbindd.c
@@ -549,7 +549,6 @@ static void response_extra_sent(void *private_data, bool success)
 		return;
 	}
 
-	SAFE_FREE(state->request.extra_data.data);
 	SAFE_FREE(state->response.extra_data.data);
 
 	setup_async_read(&state->fd_event, &state->request, sizeof(uint32),
@@ -581,6 +580,8 @@ static void response_main_sent(void *private_data, bool success)
 
 static void request_finished(struct winbindd_cli_state *state)
 {
+	/* Make sure request.extra_data is freed when finish processing a request */
+	SAFE_FREE(state->request.extra_data.data);
 	setup_async_write(&state->fd_event, &state->response,
 			  sizeof(state->response), response_main_sent, state);
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list