(krb5_get_error_message): peek inside the context and make a copy of

the error string.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16696 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-02-03 12:47:01 +00:00
parent 713880c9a3
commit 07bb0509dd

View File

@@ -111,9 +111,12 @@ krb5_have_error_string(krb5_context context)
char * KRB5_LIB_FUNCTION char * KRB5_LIB_FUNCTION
krb5_get_error_message(krb5_context context, krb5_error_code code) krb5_get_error_message(krb5_context context, krb5_error_code code)
{ {
char *str; char *str = NULL;
str = krb5_get_error_string(context); HEIMDAL_MUTEX_lock(context->mutex);
if (context->error_string)
str = strdup(context->error_string);
HEIMDAL_MUTEX_unlock(context->mutex);
if (str) if (str)
return str; return str;