--- samba-3.0.26a.orig/source/libaddns/dnsgss.c 2007-03-20 23:25:36.000000000 +0100 +++ samba-3.0.26a/source/libaddns/dnsgss.c 2007-09-12 15:27:07.000000000 +0200 @@ -219,8 +219,6 @@ gss_buffer_desc input_name; struct dns_connection *conn; - gss_name_t targ_name; - krb5_principal host_principal; krb5_context krb_ctx = NULL; @@ -252,29 +250,10 @@ krb5_init_context( &krb_ctx ); krb5_parse_name( krb_ctx, targetname, &host_principal ); - /* don't free the principal 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 ); - - major = gss_import_name( &minor, &input_name, - &nt_host_oid_desc, &targ_name ); - - if (major) { - krb5_free_principal( krb_ctx, host_principal ); - krb5_free_context( krb_ctx ); - err = ERROR_DNS_GSS_ERROR; - goto error; - } - err = dns_negotiate_gss_ctx_int(mem_ctx, conn, keyname, - targ_name, gss_ctx, srv_type ); - - gss_release_name( &minor, &targ_name ); + host_principal, gss_ctx, srv_type ); + /* now we can free the principal */ krb5_free_principal( krb_ctx, host_principal );