summaryrefslogtreecommitdiff
path: root/source3/smbd/ipc.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-12-15 00:49:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:29 -0500
commitd29722e378011e6085e007e1e6c39a9f002eb2fe (patch)
tree33868139ba382717ad5ed5b5067723cc6bbaf18b /source3/smbd/ipc.c
parent806daad51088bddcedda0274333b3f9e17cc26b3 (diff)
downloadsamba-d29722e378011e6085e007e1e6c39a9f002eb2fe.tar.gz
samba-d29722e378011e6085e007e1e6c39a9f002eb2fe.tar.bz2
samba-d29722e378011e6085e007e1e6c39a9f002eb2fe.zip
r20178: Ensure we allocate the intermediate trans structs
off conn->mem_ctx, not the null context so we can safefy free everything on conn close. Should fix possible memleak. Jeremy. (This used to be commit b33bde7b39953e171f05cdb53b6345ee3a9ec6e7)
Diffstat (limited to 'source3/smbd/ipc.c')
-rw-r--r--source3/smbd/ipc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 08381524c0..9d347a430b 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -447,7 +447,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf,
return ERROR_NT(result);
}
- if ((state = TALLOC_P(NULL, struct trans_state)) == NULL) {
+ if ((state = TALLOC_P(conn->mem_ctx, struct trans_state)) == NULL) {
DEBUG(0, ("talloc failed\n"));
END_PROFILE(SMBtrans);
return ERROR_NT(NT_STATUS_NO_MEMORY);
@@ -458,6 +458,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf,
state->mid = SVAL(inbuf, smb_mid);
state->vuid = SVAL(inbuf, smb_uid);
state->setup_count = CVAL(inbuf, smb_suwcnt);
+ state->setup = NULL;
state->total_param = SVAL(inbuf, smb_tpscnt);
state->param = NULL;
state->total_data = SVAL(inbuf, smb_tdscnt);