gensec: clarify memory ownership for gensec_session_info() and gensec_session_key()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 1 Aug 2011 05:39:01 +0000 (15:39 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 3 Aug 2011 08:48:02 +0000 (18:48 +1000)
commit35b309fa0cac9341f364243b03ebfcc80f74198e
treeb99fc49ec70be97a41289b3978db367fba63a769
parentd3fe48ba48b25f359292ee96dbf5cecc0b0b16a3
gensec: clarify memory ownership for gensec_session_info() and gensec_session_key()

This is slightly less efficient, because we no longer keep a cache on
the gensec structures, but much clearer in terms of memory ownership.
Both gensec_session_info() and gensec_session_key() now take a mem_ctx
and put the result only on that context.

Some duplication of memory in the callers (who were rightly uncertain
about who was the rightful owner of the returned memory) has been
removed to compensate for the internal copy.

Andrew Bartlett
24 files changed:
auth/gensec/gensec.c
auth/gensec/gensec.h
source4/auth/gensec/gensec_gssapi.c
source4/auth/gensec/gensec_gssapi.h
source4/auth/gensec/gensec_krb5.c
source4/auth/gensec/pygensec.c
source4/auth/gensec/schannel.c
source4/auth/gensec/spnego.c
source4/auth/ntlmssp/ntlmssp.c
source4/auth/ntlmssp/ntlmssp_server.c
source4/dsdb/repl/drepl_out_helpers.c
source4/kdc/kpasswdd.c
source4/ldap_server/ldap_bind.c
source4/libcli/smb2/session.c
source4/libcli/smb_composite/sesssetup.c
source4/libnet/libnet_become_dc.c
source4/libnet/py_net.c
source4/rpc_server/dcesrv_auth.c
source4/smb_server/smb/sesssetup.c
source4/smb_server/smb2/sesssetup.c
source4/torture/drs/rpc/dssync.c
source4/torture/drs/rpc/msds_intid.c
source4/torture/rpc/remote_pac.c
source4/utils/ntlm_auth.c