From 8750984c0775daaac6c5fd85fd65a9622331fa31 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 28 Jul 2004 23:48:05 +0000 Subject: [PATCH] * gssapi_krb5.c (kg_get_ccache_name): Make a copy of the default ccache name, because calling krb5_free_context will destroy it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16627 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/ChangeLog | 5 +++++ src/lib/gssapi/krb5/gssapi_krb5.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 075416d15..e18658f3a 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,8 @@ +2004-07-28 Ken Raeburn + + * gssapi_krb5.c (kg_get_ccache_name): Make a copy of the default + ccache name, because calling krb5_free_context will destroy it. + 2004-07-14 Ken Raeburn * gssapi_krb5.c (kg_sync_ccache_name): Add context argument diff --git a/src/lib/gssapi/krb5/gssapi_krb5.c b/src/lib/gssapi/krb5/gssapi_krb5.c index b19f1a73f..de5f50c24 100644 --- a/src/lib/gssapi/krb5/gssapi_krb5.c +++ b/src/lib/gssapi/krb5/gssapi_krb5.c @@ -189,8 +189,10 @@ kg_get_ccache_name (OM_uint32 *minor_status, const char **out_name) err = krb5_init_context(&context); if (!err) err = krb5_cc_set_default_name (context, NULL); - if (!err) + if (!err) { name = krb5_cc_default_name(context); + name = strdup(name); + } if (context) krb5_free_context(context); } -- 2.26.2