diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-25 08:16:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:12 -0500 |
commit | 045543b661c1ee2c1dac72203e634b9a08568081 (patch) | |
tree | 125df7145d8d748dbdadc21091cb3eaee601a599 /source4/smb_server/nttrans.c | |
parent | 20fb9ab6cdd3be9c9ffc897108dedb0f142122f1 (diff) | |
download | samba-045543b661c1ee2c1dac72203e634b9a08568081.tar.gz samba-045543b661c1ee2c1dac72203e634b9a08568081.tar.bz2 samba-045543b661c1ee2c1dac72203e634b9a08568081.zip |
r2618: before we had refererence counts in talloc I added a hack in the
server side request structure to prevent a structing being freed in
some circumstances. This change replaces this with the much more
robust mechanism of talloc_increase_ref_count().
(This used to be commit 3f7741f178b359f81cc98ef18cd69bf976123e9f)
Diffstat (limited to 'source4/smb_server/nttrans.c')
-rw-r--r-- | source4/smb_server/nttrans.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source4/smb_server/nttrans.c b/source4/smb_server/nttrans.c index bd8c49c594..683e9e3386 100644 --- a/source4/smb_server/nttrans.c +++ b/source4/smb_server/nttrans.c @@ -198,8 +198,6 @@ void reply_nttrans(struct smbsrv_request *req) params = trans.out.params.data; data = trans.out.data.data; - req->control_flags |= REQ_CONTROL_PROTECTED; - /* we need to divide up the reply into chunks that fit into the negotiated buffer size */ do { @@ -254,9 +252,9 @@ void reply_nttrans(struct smbsrv_request *req) params += this_param; data += this_data; - /* if this is the last chunk then the request can be destroyed */ - if (params_left == 0 && data_left == 0) { - req->control_flags &= ~REQ_CONTROL_PROTECTED; + /* don't destroy unless this is the last segment */ + if (params_left != 0 || data_left != 0) { + talloc_increase_ref_count(req); } req_send_reply(req); |