summaryrefslogtreecommitdiffstats
path: root/source3/libaddns/dnsgss.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-12-01 14:18:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:16 -0500
commit0d38f8af3946ed14be95430286465436829507ba (patch)
tree54f9a7caf0772ad7fc8e5f7c857249c358e84014 /source3/libaddns/dnsgss.c
parent4c98afb2de51e17d848c100e46f1268722f7f5b5 (diff)
downloadsamba-0d38f8af3946ed14be95430286465436829507ba.tar.gz
samba-0d38f8af3946ed14be95430286465436829507ba.tar.xz
samba-0d38f8af3946ed14be95430286465436829507ba.zip
r19977: * Fix a crash in the secure DNS update code. Don't free
the host_principal memory while it is still being referenced by the gss code. (This used to be commit 7a5a12e892171f0e1b6355f84ee920307834c81f)
Diffstat (limited to 'source3/libaddns/dnsgss.c')
-rw-r--r--source3/libaddns/dnsgss.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/libaddns/dnsgss.c b/source3/libaddns/dnsgss.c
index fc674a7b816..3d1a038363d 100644
--- a/source3/libaddns/dnsgss.c
+++ b/source3/libaddns/dnsgss.c
@@ -243,10 +243,9 @@ DNS_ERROR dns_negotiate_sec_ctx( const char *target_realm,
major = gss_import_name( &minor, &input_name,
&nt_host_oid_desc, &targ_name );
- krb5_free_principal( krb_ctx, host_principal );
- krb5_free_context( krb_ctx );
-
if (major) {
+ krb5_free_principal( krb_ctx, host_principal );
+ krb5_free_context( krb_ctx );
err = ERROR_DNS_GSS_ERROR;
goto error;
}
@@ -254,6 +253,8 @@ DNS_ERROR dns_negotiate_sec_ctx( const char *target_realm,
err = dns_negotiate_gss_ctx_int(mem_ctx, conn, keyname, targ_name,
gss_ctx);
+ krb5_free_principal( krb_ctx, host_principal );
+ krb5_free_context( krb_ctx );
gss_release_name( &minor, &targ_name );
error: