summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-25 11:48:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:14 -0500
commit223e78990a16f134a01d1223a0dad8b2accd5fed (patch)
tree96f634dc3fa74d9b4b6385ab67bbd3741d48bba2 /source4
parentd79c7d41da373dea7f95506c178b18f0dd896043 (diff)
downloadsamba-223e78990a16f134a01d1223a0dad8b2accd5fed.tar.gz
samba-223e78990a16f134a01d1223a0dad8b2accd5fed.tar.bz2
samba-223e78990a16f134a01d1223a0dad8b2accd5fed.zip
r2628: got rid of some warnings and converted a few more places to use hierarchical memory allocation
(This used to be commit 26da45a8019a2d6c9ff2ac2a6739c7d0b42b00de)
Diffstat (limited to 'source4')
-rw-r--r--source4/ldap_server/ldap_server.c2
-rw-r--r--source4/lib/socket/socket_ipv4.c2
-rw-r--r--source4/librpc/rpc/dcerpc.c3
-rw-r--r--source4/librpc/rpc/dcerpc_smb.c2
-rw-r--r--source4/librpc/rpc/dcerpc_tcp.c2
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c4
-rw-r--r--source4/smbd/service.c15
-rw-r--r--source4/torture/basic/charset.c2
8 files changed, 17 insertions, 15 deletions
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c
index 31376a7db2..976b55ee01 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -612,7 +612,7 @@ static void ldapsrv_accept(struct server_connection *conn)
DEBUG(5, ("ldapsrv_accept\n"));
- ldap_conn = talloc_p(NULL, struct ldapsrv_connection);
+ ldap_conn = talloc_p(conn, struct ldapsrv_connection);
if (ldap_conn == NULL)
return;
diff --git a/source4/lib/socket/socket_ipv4.c b/source4/lib/socket/socket_ipv4.c
index 67f1e99d17..c98e5534ca 100644
--- a/source4/lib/socket/socket_ipv4.c
+++ b/source4/lib/socket/socket_ipv4.c
@@ -153,7 +153,7 @@ static NTSTATUS ipv4_tcp_accept(struct socket_context *sock, struct socket_conte
socklen_t cli_addr_len = 0;
int new_fd;
- new_fd = accept(sock->fd, &cli_addr, &cli_addr_len);
+ new_fd = accept(sock->fd, (struct sockaddr *)&cli_addr, &cli_addr_len);
if (new_fd == -1) {
/* TODO: we need to map from errno to NTSTATUS here! */
return NT_STATUS_FOOBAR;
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 23e9f04d96..352db37d2b 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -22,8 +22,7 @@
#include "includes.h"
-/* initialise a dcerpc pipe. This currently assumes a SMB named pipe
- transport */
+/* initialise a dcerpc pipe. */
struct dcerpc_pipe *dcerpc_pipe_init(void)
{
struct dcerpc_pipe *p;
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index d80d5ea927..dac95f5aec 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -433,7 +433,7 @@ NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe **p,
/* Over-ride the default session key with the SMB session key */
(*p)->security_state.session_key = smb_session_key;
- smb = talloc((*p), sizeof(*smb));
+ smb = talloc_p((*p), struct smb_private);
if (!smb) {
dcerpc_pipe_close(*p);
return NT_STATUS_NO_MEMORY;
diff --git a/source4/librpc/rpc/dcerpc_tcp.c b/source4/librpc/rpc/dcerpc_tcp.c
index 170e84a763..acf3d58262 100644
--- a/source4/librpc/rpc/dcerpc_tcp.c
+++ b/source4/librpc/rpc/dcerpc_tcp.c
@@ -329,7 +329,7 @@ NTSTATUS dcerpc_pipe_open_tcp(struct dcerpc_pipe **p,
set_socket_options(fd, lp_socket_options());
- if (!(*p = dcerpc_pipe_init())) {
+ if (!(*p = dcerpc_pipe_init())) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 7e4e89f51d..d68591fd0c 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -47,13 +47,13 @@ static NTSTATUS samr_Connect(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem
ZERO_STRUCTP(r->out.connect_handle);
- c_state = talloc_p(NULL, struct samr_connect_state);
+ c_state = talloc_p(dce_call->conn, struct samr_connect_state);
if (!c_state) {
return NT_STATUS_NO_MEMORY;
}
/* make sure the sam database is accessible */
- c_state->sam_ctx = samdb_connect(mem_ctx);
+ c_state->sam_ctx = samdb_connect(c_state);
if (c_state->sam_ctx == NULL) {
talloc_free(c_state);
return NT_STATUS_INVALID_SYSTEM_SERVICE;
diff --git a/source4/smbd/service.c b/source4/smbd/service.c
index 8f10c06dff..0733e6fc0f 100644
--- a/source4/smbd/service.c
+++ b/source4/smbd/service.c
@@ -101,9 +101,9 @@ struct server_context *server_service_startup(const char *model)
if you pass *port == 0, then a port > 1024 is used
*/
struct server_socket *service_setup_socket(struct server_service *service,
- const struct model_ops *model_ops,
- const char *sock_addr,
- uint16_t *port)
+ const struct model_ops *model_ops,
+ const char *sock_addr,
+ uint16_t *port)
{
NTSTATUS status;
struct server_socket *srv_sock;
@@ -155,7 +155,7 @@ struct server_socket *service_setup_socket(struct server_service *service,
return NULL;
}
- srv_sock = talloc_p(NULL, struct server_socket);
+ srv_sock = talloc_p(service, struct server_socket);
if (!srv_sock) {
DEBUG(0,("talloc_p(mem_ctx, struct server_socket) failed\n"));
socket_destroy(socket_ctx);
@@ -185,13 +185,16 @@ struct server_socket *service_setup_socket(struct server_service *service,
return srv_sock;
}
-struct server_connection *server_setup_connection(struct event_context *ev, struct server_socket *server_socket, struct socket_context *sock, time_t t)
+struct server_connection *server_setup_connection(struct event_context *ev,
+ struct server_socket *server_socket,
+ struct socket_context *sock,
+ time_t t)
{
struct fd_event fde;
struct timed_event idle;
struct server_connection *srv_conn;
- srv_conn = talloc_p(NULL, struct server_connection);
+ srv_conn = talloc_p(server_socket, struct server_connection);
if (!srv_conn) {
DEBUG(0,("talloc_p(mem_ctx, struct server_service_connection) failed\n"));
return NULL;
diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c
index cb29645de6..d36c9f5b91 100644
--- a/source4/torture/basic/charset.c
+++ b/source4/torture/basic/charset.c
@@ -40,7 +40,7 @@ static NTSTATUS unicode_open(struct smbcli_tree *tree,
int i;
NTSTATUS status;
- ucs_name = talloc(NULL, (1+u_name_len)*2);
+ ucs_name = talloc(mem_ctx, (1+u_name_len)*2);
if (!ucs_name) {
printf("Failed to create UCS2 Name - talloc() failure\n");
return NT_STATUS_NO_MEMORY;