summaryrefslogtreecommitdiff
path: root/third_party/heimdal/lib/gssapi/spnego/negoex_ctx.c
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2022-03-01 14:17:54 +1300
committerJoseph Sutton <jsutton@samba.org>2022-03-01 22:34:34 +0000
commit51569b3152a952d07fddaa3a70d60c920618c704 (patch)
tree4e447f5d9eb04c7acadf3cff4547068fc79d2113 /third_party/heimdal/lib/gssapi/spnego/negoex_ctx.c
parentfccf9859786dfb50b317ea2296c2494997f0ae09 (diff)
downloadsamba-51569b3152a952d07fddaa3a70d60c920618c704.tar.gz
third_party/heimdal: import lorikeet-heimdal-202203010107 (commit 0e7a12404c388e831fe6933fcc3c86e7eb334825)
NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN! BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'third_party/heimdal/lib/gssapi/spnego/negoex_ctx.c')
-rw-r--r--third_party/heimdal/lib/gssapi/spnego/negoex_ctx.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/third_party/heimdal/lib/gssapi/spnego/negoex_ctx.c b/third_party/heimdal/lib/gssapi/spnego/negoex_ctx.c
index 13e28bb59fd..3f8aa5c3e7b 100644
--- a/third_party/heimdal/lib/gssapi/spnego/negoex_ctx.c
+++ b/third_party/heimdal/lib/gssapi/spnego/negoex_ctx.c
@@ -904,12 +904,14 @@ cleanup:
if (GSS_ERROR(major)) {
if (!mech_error) {
- krb5_context context = _gss_mg_krb5_context();
-
- gss_mg_set_error_string(GSS_SPNEGO_MECHANISM,
- major, *minor,
- "NegoEx failed to initialize security context: %s",
- krb5_get_error_message(context, *minor));
+ krb5_context context = _gss_mg_krb5_context();
+ const char *emsg = krb5_get_error_message(context, *minor);
+
+ gss_mg_set_error_string(GSS_SPNEGO_MECHANISM,
+ major, *minor,
+ "NegoEx failed to initialize security context: %s",
+ emsg);
+ krb5_free_error_message(context, emsg);
}
_gss_negoex_release_context(ctx);
@@ -1022,12 +1024,14 @@ cleanup:
if (GSS_ERROR(major)) {
if (!mech_error) {
- krb5_context context = _gss_mg_krb5_context();
-
- gss_mg_set_error_string(GSS_SPNEGO_MECHANISM,
- major, *minor,
- "NegoEx failed to accept security context: %s",
- krb5_get_error_message(context, *minor));
+ krb5_context context = _gss_mg_krb5_context();
+ const char *emsg = krb5_get_error_message(context, *minor);
+
+ gss_mg_set_error_string(GSS_SPNEGO_MECHANISM,
+ major, *minor,
+ "NegoEx failed to accept security context: %s",
+ emsg);
+ krb5_free_error_message(context, emsg);
}
_gss_negoex_release_context(ctx);