s4 librpc rpc pyrpc: Ensure tevent_context deleted last
authorGary Lockyer <gary@catalyst.net.nz>
Tue, 7 May 2019 23:30:20 +0000 (11:30 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 10 May 2019 08:19:16 +0000 (08:19 +0000)
commitd65b7641c84976c543ded8f0de5ab2da3c19b407
tree599b01fe8cc3296eb7b03c1a8c8716d02c530c86
parent165025a56e14eca51f3db366300fe625d1f521b5
s4 librpc rpc pyrpc: Ensure tevent_context deleted last

Ensure that the tevent_context is deleted after the connection, to
prevent a use after free.

Note: Py_DECREF calls dcerpc_interface_dealloc so the
TALLOC_FREE(ret->mem_ctx) calls in the error paths of
py_dcerpc_interface_init_helper needed removal.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13932

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/librpc/rpc/pyrpc.c
source4/librpc/rpc/pyrpc.h
source4/librpc/rpc/pyrpc_util.c