From 38c287740f9b6a9cb8f093de864f8fd5e98eff9c Mon Sep 17 00:00:00 2001 From: Qiao Yang Date: Fri, 5 Sep 2008 14:08:09 +0200 Subject: 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) --- source3/winbindd/winbindd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3') 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); } -- cgit