krb5 commit: Fix minor leak when loading GSS mechanisms
Greg Hudson
ghudson at mit.edu
Mon Oct 21 18:22:56 EDT 2019
https://github.com/krb5/krb5/commit/d09215c926834d8fa5b4bdb98967bf6c9ff8fda4
commit d09215c926834d8fa5b4bdb98967bf6c9ff8fda4
Author: Greg Hudson <ghudson at mit.edu>
Date: Wed Oct 16 15:16:54 2019 -0400
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.
src/lib/gssapi/mechglue/g_initialize.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/lib/gssapi/mechglue/g_initialize.c b/src/lib/gssapi/mechglue/g_initialize.c
index 394869e..0054acf 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;
}
More information about the cvs-krb5
mailing list