free auth_context on close [CID-97]

This commit is contained in:
Love Hornquist Astrand
2009-07-30 11:55:42 +02:00
parent 2127d8d6bc
commit b2aaf4f306

View File

@@ -146,6 +146,7 @@ proto (int sock, const char *hostname, const char *service,
auth_context, auth_context,
&sock); &sock);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn (context, status, "krb5_auth_con_setaddr"); krb5_warn (context, status, "krb5_auth_con_setaddr");
return 1; return 1;
} }
@@ -156,6 +157,7 @@ proto (int sock, const char *hostname, const char *service,
KRB5_NT_SRV_HST, KRB5_NT_SRV_HST,
&server); &server);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn (context, status, "krb5_sname_to_principal"); krb5_warn (context, status, "krb5_sname_to_principal");
return 1; return 1;
} }
@@ -174,6 +176,7 @@ proto (int sock, const char *hostname, const char *service,
NULL, NULL,
NULL); NULL);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn(context, status, "krb5_sendauth"); krb5_warn(context, status, "krb5_sendauth");
return 1; return 1;
} }
@@ -185,6 +188,7 @@ proto (int sock, const char *hostname, const char *service,
data_send.length = strlen(remote_name) + 1; data_send.length = strlen(remote_name) + 1;
status = krb5_write_priv_message(context, auth_context, &sock, &data_send); status = krb5_write_priv_message(context, auth_context, &sock, &data_send);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn (context, status, "krb5_write_message"); krb5_warn (context, status, "krb5_write_message");
return 1; return 1;
} }
@@ -192,6 +196,7 @@ proto (int sock, const char *hostname, const char *service,
data_send.length = strlen(ccache_name)+1; data_send.length = strlen(ccache_name)+1;
status = krb5_write_priv_message(context, auth_context, &sock, &data_send); status = krb5_write_priv_message(context, auth_context, &sock, &data_send);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn (context, status, "krb5_write_message"); krb5_warn (context, status, "krb5_write_message");
return 1; return 1;
} }
@@ -200,12 +205,14 @@ proto (int sock, const char *hostname, const char *service,
status = krb5_cc_default (context, &ccache); status = krb5_cc_default (context, &ccache);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn (context, status, "krb5_cc_default"); krb5_warn (context, status, "krb5_cc_default");
return 1; return 1;
} }
status = krb5_cc_get_principal (context, ccache, &principal); status = krb5_cc_get_principal (context, ccache, &principal);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn (context, status, "krb5_cc_get_principal"); krb5_warn (context, status, "krb5_cc_get_principal");
return 1; return 1;
} }
@@ -220,6 +227,7 @@ proto (int sock, const char *hostname, const char *service,
NULL); NULL);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn (context, status, "krb5_make_principal"); krb5_warn (context, status, "krb5_make_principal");
return 1; return 1;
} }
@@ -238,6 +246,7 @@ proto (int sock, const char *hostname, const char *service,
&creds, &creds,
&data); &data);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn (context, status, "krb5_get_forwarded_creds"); krb5_warn (context, status, "krb5_get_forwarded_creds");
return 1; return 1;
} }
@@ -245,6 +254,7 @@ proto (int sock, const char *hostname, const char *service,
status = krb5_write_priv_message(context, auth_context, &sock, &data); status = krb5_write_priv_message(context, auth_context, &sock, &data);
if (status) { if (status) {
krb5_auth_con_free(context, auth_context);
krb5_warn (context, status, "krb5_mk_priv"); krb5_warn (context, status, "krb5_mk_priv");
return 1; return 1;
} }
@@ -252,6 +262,7 @@ proto (int sock, const char *hostname, const char *service,
krb5_data_free (&data); krb5_data_free (&data);
status = krb5_read_priv_message(context, auth_context, &sock, &data); status = krb5_read_priv_message(context, auth_context, &sock, &data);
krb5_auth_con_free(context, auth_context);
if (status) { if (status) {
krb5_warn (context, status, "krb5_mk_priv"); krb5_warn (context, status, "krb5_mk_priv");
return 1; return 1;