]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix smbd crash for close_on_completion
authorVolker Lendecke <vl@samba.org>
Sat, 28 Mar 2009 18:58:45 +0000 (19:58 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 5 Apr 2009 12:34:14 +0000 (14:34 +0200)
handle_trans() can talloc_free "conn" if the client requests
close_on_completion. "state" is a talloc_child of conn, so it will be gone when
we later free state->data et al.

source3/smbd/ipc.c

index d39aab4f471ab66938da3aa1c7c3c0acf78a1187..2d5713590d8ca493d6277bd54620ebcd7695e1bf 100644 (file)
@@ -754,6 +754,8 @@ void reply_trans(struct smb_request *req)
                return;
        }
 
+       talloc_steal(talloc_tos(), state);
+
        handle_trans(conn, req, state);
 
        SAFE_FREE(state->data);
@@ -852,6 +854,8 @@ void reply_transs(struct smb_request *req)
                return;
        }
 
+       talloc_steal(talloc_tos(), state);
+
        handle_trans(conn, req, state);
 
        DLIST_REMOVE(conn->pending_trans, state);