summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/winbindd.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-14 12:58:19 +0200
committerVolker Lendecke <vl@samba.org>2009-06-14 22:22:10 +0200
commit49eccee209f01af043d084742bbbc9d4519eddfc (patch)
treef9b2e6628d8a0a8bcda87ed710d6421d97a725ad /source3/winbindd/winbindd.c
parent97ba4f6efdcdb1e4f5d43ddeadfd06c7d96213f4 (diff)
downloadsamba-49eccee209f01af043d084742bbbc9d4519eddfc.tar.gz
samba-49eccee209f01af043d084742bbbc9d4519eddfc.tar.xz
samba-49eccee209f01af043d084742bbbc9d4519eddfc.zip
Remove "winbindd_request" and "winbindd_response" from winbindd_cli_state
This shrinks the memory footprint of an idle client by 5592 bytes to 60 bytes on my 32-bit box.
Diffstat (limited to 'source3/winbindd/winbindd.c')
-rw-r--r--source3/winbindd/winbindd.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 9cc1bf27018..0a73c0ebc6c 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -531,11 +531,6 @@ static void process_request(struct winbindd_cli_state *state)
struct winbindd_dispatch_table *table = dispatch_table;
struct winbindd_async_dispatch_table *atable;
- ZERO_STRUCTP(state->response);
-
- state->response->result = WINBINDD_PENDING;
- state->response->length = sizeof(struct winbindd_response);
-
state->mem_ctx = talloc_init("winbind request");
if (state->mem_ctx == NULL)
return;
@@ -570,6 +565,16 @@ static void process_request(struct winbindd_cli_state *state)
return;
}
+ state->response = talloc_zero(state->mem_ctx,
+ struct winbindd_response);
+ if (state->response == NULL) {
+ DEBUG(10, ("talloc failed\n"));
+ remove_client(state);
+ return;
+ }
+ state->response->result = WINBINDD_PENDING;
+ state->response->length = sizeof(struct winbindd_response);
+
for (table = dispatch_table; table->fn; table++) {
if (state->request->cmd == table->cmd) {
DEBUG(10,("process_request: request fn %s\n",
@@ -709,7 +714,6 @@ static void new_connection(int listen_sock, bool privileged)
}
state->sock = sock;
- state->response = &state->_response;
state->out_queue = tevent_queue_create(state, "winbind client reply");
if (state->out_queue == NULL) {