summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/blocking.c4
-rw-r--r--source3/smbd/lanman.c2
-rw-r--r--source3/smbd/negprot.c2
-rw-r--r--source3/smbd/notify.c2
-rw-r--r--source3/smbd/nttrans.c2
-rw-r--r--source3/smbd/open.c4
-rw-r--r--source3/smbd/posix_acls.c4
-rw-r--r--source3/smbd/process.c10
-rw-r--r--source3/smbd/server.c3
-rw-r--r--source3/smbd/trans2.c4
10 files changed, 16 insertions, 21 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index 3bf6e0f99a..ef70829f74 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -255,7 +255,7 @@ static void reply_lockingX_success(blocking_lock_record *blr)
{
struct smb_request *req;
- if (!(req = talloc(tmp_talloc_ctx(), struct smb_request))) {
+ if (!(req = talloc(talloc_tos(), struct smb_request))) {
smb_panic("Could not allocate smb_request");
}
@@ -526,7 +526,7 @@ static BOOL process_trans2(blocking_lock_record *blr)
/* We finally got the lock, return success. */
- if (!(req = talloc(tmp_talloc_ctx(), struct smb_request))) {
+ if (!(req = talloc(talloc_tos(), struct smb_request))) {
blocking_lock_reply_error(blr, NT_STATUS_NO_MEMORY);
return True;
}
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 1d6369c18b..581ac90aeb 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -4216,7 +4216,7 @@ static BOOL api_RNetSessionEnum(connection_struct *conn, uint16 vuid,
return False;
}
- num_sessions = list_sessions(tmp_talloc_ctx(), &session_list);
+ num_sessions = list_sessions(talloc_tos(), &session_list);
if (mdrcnt > 0) {
*rdata = SMB_REALLOC_LIMIT(*rdata,mdrcnt);
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 4437f0bd3f..98109a2149 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -543,7 +543,7 @@ void reply_negprot(connection_struct *conn, struct smb_request *req)
char **tmp;
- tmp = TALLOC_REALLOC_ARRAY(tmp_talloc_ctx(), cliprotos, char *,
+ tmp = TALLOC_REALLOC_ARRAY(talloc_tos(), cliprotos, char *,
num_cliprotos+1);
if (tmp == NULL) {
DEBUG(0, ("talloc failed\n"));
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
index 0bdf466092..da80c25407 100644
--- a/source3/smbd/notify.c
+++ b/source3/smbd/notify.c
@@ -176,7 +176,7 @@ void change_notify_reply(const uint8 *request_buf, uint32 max_param,
goto done;
}
- if (!(req = talloc(tmp_talloc_ctx(), struct smb_request))) {
+ if (!(req = talloc(talloc_tos(), struct smb_request))) {
change_notify_reply_packet(request_buf, NT_STATUS_NO_MEMORY);
goto done;
}
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index f5c5db72a0..b5af173d45 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1484,7 +1484,7 @@ static void call_nt_transact_create(connection_struct *conn,
pdata = data + sd_len;
/* We have already checked that ea_len <= data_count here. */
- ea_list = read_nttrans_ea_list(tmp_talloc_ctx(), pdata,
+ ea_list = read_nttrans_ea_list(talloc_tos(), pdata,
ea_len);
if (!ea_list ) {
TALLOC_FREE(case_state);
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 725d72b284..6efef2f912 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1159,7 +1159,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
return print_fsp_open(conn, fname, result);
}
- if (!parent_dirname_talloc(tmp_talloc_ctx(), fname, &parent_dir,
+ if (!parent_dirname_talloc(talloc_tos(), fname, &parent_dir,
&newname)) {
return NT_STATUS_NO_MEMORY;
}
@@ -1979,7 +1979,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
return status;
}
- if (!parent_dirname_talloc(tmp_talloc_ctx(), name, &parent_dir,
+ if (!parent_dirname_talloc(talloc_tos(), name, &parent_dir,
&dirname)) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 6286cd0414..64051d23b1 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -2971,14 +2971,14 @@ size_t get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
}
if (num_aces) {
- if((psa = make_sec_acl( main_loop_talloc_get(), NT4_ACL_REVISION, num_aces, nt_ace_list)) == NULL) {
+ if((psa = make_sec_acl( talloc_tos(), NT4_ACL_REVISION, num_aces, nt_ace_list)) == NULL) {
DEBUG(0,("get_nt_acl: Unable to malloc space for acl.\n"));
goto done;
}
}
} /* security_info & DACL_SECURITY_INFORMATION */
- psd = make_standard_sec_desc( main_loop_talloc_get(),
+ psd = make_standard_sec_desc( talloc_tos(),
(security_info & OWNER_SECURITY_INFORMATION) ? &owner_sid : NULL,
(security_info & GROUP_SECURITY_INFORMATION) ? &group_sid : NULL,
psa,
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 99898141db..8b3e85f4b4 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1125,7 +1125,7 @@ static void construct_reply(char *inbuf, int size)
file_chain_reset();
reset_chain_p();
- if (!(req = talloc(tmp_talloc_ctx(), struct smb_request))) {
+ if (!(req = talloc(talloc_tos(), struct smb_request))) {
smb_panic("could not allocate smb_request");
}
init_smb_request(req, (uint8 *)inbuf);
@@ -1346,7 +1346,7 @@ void chain_reply(struct smb_request *req)
DEBUG(3,("Chained message\n"));
show_msg(inbuf2);
- if (!(req2 = talloc(tmp_talloc_ctx(), struct smb_request))) {
+ if (!(req2 = talloc(talloc_tos(), struct smb_request))) {
smb_panic("could not allocate smb_request");
}
init_smb_request(req2, (uint8 *)inbuf2);
@@ -1634,13 +1634,10 @@ void smbd_process(void)
int num_echos;
char *inbuf;
size_t inbuf_len;
+ TALLOC_CTX *frame = talloc_stackframe();
errno = 0;
- /* free up temporary memory */
- lp_TALLOC_FREE();
- main_loop_TALLOC_FREE();
-
/* Did someone ask for immediate checks on things like blocking locks ? */
if (select_timeout == 0) {
if(!timeout_processing(&select_timeout,
@@ -1713,5 +1710,6 @@ void smbd_process(void)
change_to_root_user();
check_log_size();
}
+ TALLOC_FREE(frame);
}
}
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 7e55d3c086..72eeb7ee6a 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -384,9 +384,6 @@ static BOOL open_sockets_smbd(enum smb_server_mode server_mode, const char *smb_
fd_set r_fds, w_fds;
int num;
- /* Free up temporary memory from the main smbd. */
- lp_TALLOC_FREE();
-
/* Ensure we respond to PING and DEBUG messages from the main smbd. */
message_dispatch(smbd_messaging_context());
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index dd3363b20c..ed4d4554d4 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -888,7 +888,7 @@ static void call_trans2open(connection_struct *conn,
return;
}
- ea_list = read_ea_list(tmp_talloc_ctx(), pdata + 4,
+ ea_list = read_ea_list(talloc_tos(), pdata + 4,
total_data - 4);
if (!ea_list) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
@@ -6613,7 +6613,7 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req,
return;
}
- ea_list = read_ea_list(tmp_talloc_ctx(), pdata + 4,
+ ea_list = read_ea_list(talloc_tos(), pdata + 4,
total_data - 4);
if (!ea_list) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);