summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-03-15 22:09:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:38 -0500
commitc042d06490cc02ec17376c7c057be9f809ca1c6e (patch)
tree9fc546e2e9fd238efc302a2f5bf63435318196e3 /source3
parent7d77dd9db600a4b2ee11913bf8169224c2d9424a (diff)
downloadsamba-c042d06490cc02ec17376c7c057be9f809ca1c6e.tar.gz
samba-c042d06490cc02ec17376c7c057be9f809ca1c6e.tar.bz2
samba-c042d06490cc02ec17376c7c057be9f809ca1c6e.zip
r21848: add a comment about gss_import_name() and when to free the krb5 principal data
(This used to be commit 54a114fa7569315a8ad391689ebf5d68ef4a62d4)
Diffstat (limited to 'source3')
-rw-r--r--source3/libaddns/dnsgss.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/libaddns/dnsgss.c b/source3/libaddns/dnsgss.c
index 798fd4404e..207e86c3ed 100644
--- a/source3/libaddns/dnsgss.c
+++ b/source3/libaddns/dnsgss.c
@@ -252,6 +252,11 @@ DNS_ERROR dns_negotiate_sec_ctx( const char *target_realm,
krb5_init_context( &krb_ctx );
krb5_parse_name( krb_ctx, targetname, &host_principal );
+ /* don't free the printcap until after you call
+ gss_release_name() or else you'll get a segv
+ as the krb5_copy_principal() does a structure
+ copy and not a deep copy. --jerry*/
+
input_name.value = &host_principal;
input_name.length = sizeof( host_principal );
@@ -267,8 +272,11 @@ DNS_ERROR dns_negotiate_sec_ctx( const char *target_realm,
err = dns_negotiate_gss_ctx_int(mem_ctx, conn, keyname,
targ_name, gss_ctx, srv_type );
-
+
gss_release_name( &minor, &targ_name );
+
+ /* now we can feree the principal */
+
krb5_free_principal( krb_ctx, host_principal );
krb5_free_context( krb_ctx );