summaryrefslogtreecommitdiffstats
path: root/source/smbd/ipc.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-12-15 00:49:12 +0000
committerJeremy Allison <jra@samba.org>2006-12-15 00:49:12 +0000
commit2eaee1a3ba0d0b2662c69b24b21dfd37c159a02e (patch)
treec4041716cb3ba7d76576aabcec211404264a2e3f /source/smbd/ipc.c
parent1a0fc60c3323e9365e8b9758886f5acbfbe5077d (diff)
downloadsamba-2eaee1a3ba0d0b2662c69b24b21dfd37c159a02e.tar.gz
samba-2eaee1a3ba0d0b2662c69b24b21dfd37c159a02e.tar.xz
samba-2eaee1a3ba0d0b2662c69b24b21dfd37c159a02e.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.
Diffstat (limited to 'source/smbd/ipc.c')
-rw-r--r--source/smbd/ipc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c
index 08381524c0d..9d347a430be 100644
--- a/source/smbd/ipc.c
+++ b/source/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);