Copy the krb5 context error.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23543 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-08-16 22:59:45 +00:00
parent 9efa43473c
commit a65167e3ce

View File

@@ -171,8 +171,11 @@ OM_uint32 _gsskrb5_display_status
calling_error(GSS_CALLING_ERROR(status_value)),
routine_error(GSS_ROUTINE_ERROR(status_value)));
} else if (status_type == GSS_C_MECH_CODE) {
buf = krb5_get_error_message(context, status_value);
if (buf == NULL) {
const char *buf2 = krb5_get_error_message(context, status_value);
if (buf2) {
buf = strdup(buf2);
krb5_free_error_message(context, buf2);
} else {
asprintf(&buf, "unknown mech error-code %u",
(unsigned)status_value);
}