X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.orig;a=blobdiff_plain;f=display_status.c;h=44b5390c5a11d77c6fba88af4f76cb95c3ef6f35;hp=ebe66bd95b4f9954e21fa6b47f3bd2ce5bcb3fea;hb=15c93f06ee6ddefa7e7b095351f6e66698c7cc9e;hpb=11f9efdde75b31b6d4b78ff04618cebd4b4496f4 diff --git a/display_status.c b/display_status.c index ebe66bd..44b5390 100644 --- a/display_status.c +++ b/display_status.c @@ -62,30 +62,32 @@ createStatusInfoKey(void) static void saveStatusInfoNoCopy(OM_uint32 minor, char *message) { - struct gss_eap_status_info *info, *p; + struct gss_eap_status_info **next = NULL, *p; GSSEAP_ONCE(&gssEapStatusInfoKeyOnce, createStatusInfoKey); - info = GSSEAP_CALLOC(1, sizeof(*info)); - if (info == NULL) { - GSSEAP_FREE(message); - return; + p = GSSEAP_GETSPECIFIC(gssEapStatusInfoKey); + for (; p != NULL; p = p->next) { + if (p->code == minor) { + p->message = message; + return; + } + next = &p->next; } - info->code = minor; - info->message = message; - - p = GSSEAP_GETSPECIFIC(gssEapStatusInfoKey); + p = GSSEAP_CALLOC(1, sizeof(*p)); if (p == NULL) { - GSSEAP_SETSPECIFIC(gssEapStatusInfoKey, info); - } else { - struct gss_eap_status_info **next = &p; + GSSEAP_FREE(message); + return; + } - for (; p != NULL; p = p->next) - next = &p->next; + p->code = minor; + p->message = message; - *next = info; - } + if (p != NULL) + *next = p; + else + GSSEAP_SETSPECIFIC(gssEapStatusInfoKey, p); } static const char *