Add krb5_get_error_message().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23195 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -128,20 +128,20 @@ krb5_have_error_string(krb5_context context)
|
|||||||
* @param code Error code related to the error
|
* @param code Error code related to the error
|
||||||
*
|
*
|
||||||
* @return an error string, needs to be freed with
|
* @return an error string, needs to be freed with
|
||||||
* krb5_free_error_string(). The functions return NULL on error.
|
* krb5_free_error_message(). The functions return NULL on error.
|
||||||
*
|
*
|
||||||
* @ingroup krb5_error
|
* @ingroup krb5_error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char * KRB5_LIB_FUNCTION
|
const 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)
|
||||||
{
|
{
|
||||||
const char *cstr;
|
const char *cstr;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
str = krb5_get_error_string(context);
|
cstr = krb5_get_error_string(context);
|
||||||
if (str)
|
if (cstr)
|
||||||
return str;
|
return cstr;
|
||||||
|
|
||||||
cstr = krb5_get_err_text(context, code);
|
cstr = krb5_get_err_text(context, code);
|
||||||
if (cstr)
|
if (cstr)
|
||||||
@@ -153,3 +153,18 @@ krb5_get_error_message(krb5_context context, krb5_error_code code)
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free the error message returned by krb5_get_error_message().
|
||||||
|
*
|
||||||
|
* @param context Kerberos context
|
||||||
|
* @param msg error message to free
|
||||||
|
*
|
||||||
|
* @ingroup krb5_error
|
||||||
|
*/
|
||||||
|
|
||||||
|
void KRB5_LIB_FUNCTION
|
||||||
|
krb5_free_error_message(krb5_context context, char *msg)
|
||||||
|
{
|
||||||
|
free(msg);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user