diff options
author | Qiao Yang <geoyang@ironport.com> | 2008-09-05 14:08:09 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-09-05 14:13:39 +0200 |
commit | 38c287740f9b6a9cb8f093de864f8fd5e98eff9c (patch) | |
tree | 389442ae197c811b0bfa36c82c7773a0b7df0cfc /source3/winbindd/winbindd.c | |
parent | 7c74e379a5f7935203c1a79120824d5f747eef31 (diff) | |
download | samba-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/winbindd/winbindd.c')
-rw-r--r-- | source3/winbindd/winbindd.c | 3 |
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); } |