diff options
author | Jeremy Allison <jra@samba.org> | 2010-01-06 13:29:35 -0800 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2010-01-18 12:33:07 +0100 |
commit | ed275341a97a4e996aa1dcfa8a8812fd223d6efc (patch) | |
tree | 600fba88ca7f80cb3d001da7645390a572c8780e | |
parent | bb064b9936f58b5fe478e5743fb4ed8cfe03ce35 (diff) | |
download | samba-ed275341a97a4e996aa1dcfa8a8812fd223d6efc.tar.gz samba-ed275341a97a4e996aa1dcfa8a8812fd223d6efc.tar.xz samba-ed275341a97a4e996aa1dcfa8a8812fd223d6efc.zip |
Second part of the fix for bug #7020 - smbd using 2G memory.
There was a second leak in the processing of the out_data.frag
prs_struct. It needs freeing once the current pdu has been returned
asynchronously.
Jeremy.
(cherry picked from commit 3c092c7acb18620e3769c791a9ea4055605247ee)
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index ffb7dde1c36..14b137b30ce 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -890,6 +890,13 @@ static ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_ out: (*is_data_outstanding) = prs_offset(&p->out_data.frag) > n; + if (p->out_data.current_pdu_sent == prs_offset(&p->out_data.frag)) { + /* We've returned everything in the out_data.frag + * so we're done with this pdu. Free it and reset + * current_pdu_sent. */ + p->out_data.current_pdu_sent = 0; + prs_mem_free(&p->out_data.frag); + } return data_returned; } |