summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorQiao Yang <geoyang@ironport.com>2008-09-05 14:08:09 +0200
committerVolker Lendecke <vl@samba.org>2008-09-05 14:13:39 +0200
commit38c287740f9b6a9cb8f093de864f8fd5e98eff9c (patch)
tree389442ae197c811b0bfa36c82c7773a0b7df0cfc /source3
parent7c74e379a5f7935203c1a79120824d5f747eef31 (diff)
downloadsamba-38c287740f9b6a9cb8f093de864f8fd5e98eff9c.tar.gz
samba-38c287740f9b6a9cb8f093de864f8fd5e98eff9c.tar.bz2
samba-38c287740f9b6a9cb8f093de864f8fd5e98eff9c.zip
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. (This used to be commit be6f12273f171a3eb1967d2299064e57d737f6a4)
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index f75af64f8f..44b5415726 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/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);
}