diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-05-12 12:38:03 +0200 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-06-06 12:26:10 +1000 |
commit | 78a8087213e0ae67d1071367dd304fd2e761216e (patch) | |
tree | e97b15c942e9df2c2dee83818e28ac1271cd44b3 | |
parent | 1812dca0aeb399254e652f91c00c31d9dd58a367 (diff) | |
download | samba-78a8087213e0ae67d1071367dd304fd2e761216e.tar.gz samba-78a8087213e0ae67d1071367dd304fd2e761216e.tar.bz2 samba-78a8087213e0ae67d1071367dd304fd2e761216e.zip |
s4-webserver: fixed a talloc reference error on startup failure
-rw-r--r-- | source4/web_server/web_server.c | 6 | ||||
-rw-r--r-- | source4/web_server/web_server.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source4/web_server/web_server.c b/source4/web_server/web_server.c index 74af4f9701..c79f69a0e2 100644 --- a/source4/web_server/web_server.c +++ b/source4/web_server/web_server.c @@ -248,15 +248,14 @@ static void websrv_send(struct stream_connection *conn, uint16_t flags) */ static void websrv_accept(struct stream_connection *conn) { - struct task_server *task = talloc_get_type(conn->private_data, struct task_server); - struct web_server_data *wdata = talloc_get_type(task->private_data, struct web_server_data); + struct web_server_data *wdata = talloc_get_type(conn->private_data, struct web_server_data); struct websrv_context *web; struct socket_context *tls_socket; web = talloc_zero(conn, struct websrv_context); if (web == NULL) goto failed; - web->task = task; + web->task = wdata->task; web->conn = conn; conn->private_data = web; talloc_set_destructor(web, websrv_destructor); @@ -312,6 +311,7 @@ static void websrv_task_init(struct task_server *task) wdata = talloc_zero(task, struct web_server_data); if (wdata == NULL) goto failed; + wdata->task = task; task->private_data = wdata; if (lpcfg_interfaces(task->lp_ctx) && lpcfg_bind_interfaces_only(task->lp_ctx)) { diff --git a/source4/web_server/web_server.h b/source4/web_server/web_server.h index aa4d83c17b..274a54a5c3 100644 --- a/source4/web_server/web_server.h +++ b/source4/web_server/web_server.h @@ -29,6 +29,7 @@ struct web_server_data { void (*http_process_input)(struct web_server_data *wdata, struct websrv_context *web); void *private_data; + struct task_server *task; }; struct http_header { |