From: Greg Hudson Date: Wed, 16 Oct 2019 19:16:54 +0000 (-0400) Subject: Fix minor leak when loading GSS mechanisms X-Git-Tag: krb5-1.18-beta1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F987%2Fhead;p=thirdparty%2Fkrb5.git Fix minor leak when loading GSS mechanisms When gssint_get_mechanism() loads a GSS mech, it must clear errinfo if krb5int_open_plugin() or krb5int_get_plugin_func() returns an error. --- diff --git a/src/lib/gssapi/mechglue/g_initialize.c b/src/lib/gssapi/mechglue/g_initialize.c index 394869e27a..0054acf88e 100644 --- a/src/lib/gssapi/mechglue/g_initialize.c +++ b/src/lib/gssapi/mechglue/g_initialize.c @@ -1155,6 +1155,7 @@ gssint_get_mechanism(gss_const_OID oid) if (krb5int_open_plugin(aMech->uLibName, &dl, &errinfo) != 0 || errinfo.code != 0) { + k5_clear_error(&errinfo); k5_mutex_unlock(&g_mechListLock); return ((gss_mechanism)NULL); } @@ -1165,6 +1166,7 @@ gssint_get_mechanism(gss_const_OID oid) aMech->mech = (*sym)(aMech->mech_type); } else { /* Try dynamic dispatch table */ + k5_clear_error(&errinfo); aMech->mech = build_dynamicMech(dl, aMech->mech_type); aMech->freeMech = 1; }