summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-27 01:36:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:20 -0500
commit5b44130afad1bb1764d986de3ef0e8e04b0e7357 (patch)
treeafea820fdfd1021b5ee55b2fa37ba1b32d334e46 /source4/librpc/rpc
parentf095a8e748a87de9f4cde117df13e8dccd8aeaa9 (diff)
downloadsamba-5b44130afad1bb1764d986de3ef0e8e04b0e7357.tar.gz
samba-5b44130afad1bb1764d986de3ef0e8e04b0e7357.tar.bz2
samba-5b44130afad1bb1764d986de3ef0e8e04b0e7357.zip
r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with memory in a top level context). Fixed it by changing the API to take a context. The context is only used if the pointer you are reallocing is NULL. (This used to be commit 8dc23821c9f54b2f13049b5e608a0cafb81aa540)
Diffstat (limited to 'source4/librpc/rpc')
-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
3 files changed, 4 insertions, 3 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 352db37d2b..d41eebbf2f 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -781,7 +781,8 @@ static void dcerpc_request_recv_data(struct dcerpc_pipe *p,
length = pkt.u.response.stub_and_verifier.length;
if (length > 0) {
- req->payload.data = talloc_realloc(req->payload.data,
+ req->payload.data = talloc_realloc(req,
+ req->payload.data,
req->payload.length + length);
if (!req->payload.data) {
req->status = NT_STATUS_NO_MEMORY;
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index 09c5f3772c..7000bcd20d 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -92,7 +92,7 @@ static void smb_read_callback(struct smbcli_request *req)
}
/* initiate another read request, as we only got part of a fragment */
- state->data.data = talloc_realloc(state->data.data, frag_length);
+ state->data.data = talloc_realloc(state, state->data.data, frag_length);
io->readx.in.mincnt = MIN(state->p->srv_max_xmit_frag,
frag_length - state->received);
diff --git a/source4/librpc/rpc/dcerpc_tcp.c b/source4/librpc/rpc/dcerpc_tcp.c
index acf3d58262..6940c7705d 100644
--- a/source4/librpc/rpc/dcerpc_tcp.c
+++ b/source4/librpc/rpc/dcerpc_tcp.c
@@ -141,7 +141,7 @@ static void tcp_process_recv(struct dcerpc_pipe *p)
}
frag_length = dcerpc_get_frag_length(&tcp->recv.data);
- tcp->recv.data.data = talloc_realloc(tcp->recv.data.data,
+ tcp->recv.data.data = talloc_realloc(tcp, tcp->recv.data.data,
frag_length);
if (tcp->recv.data.data == NULL) {
tcp_sock_dead(p, NT_STATUS_NO_MEMORY);