Subject: | memory leak in SPNEGO |
Date: | Tue, 2 Mar 2010 20:50:21 -0500 |
From: | "Arlene Berry" <aberry@likewise.com> |
To: | <krb5-bugs@mit.edu> |
We caught a memory leak in SPNEGO. This fixed it for us:
Index: src/lib/gssapi/spnego/spnego_mech.c
===================================================================
--- src/lib/gssapi/spnego/spnego_mech.c (revision 23762)
+++ src/lib/gssapi/spnego/spnego_mech.c (working copy)
@@ -1739,9 +1739,12 @@
}
if (ret == GSS_S_COMPLETE) {
*context_handle = (gss_ctx_id_t)sc->ctx_handle;
- if (sc->internal_name != GSS_C_NO_NAME &&
- src_name != NULL) {
+ if (sc->internal_name != GSS_C_NO_NAME) {
+ if (src_name != NULL) {
*src_name = sc->internal_name;
+ } else {
+ gss_release_name(&tmpmin, &sc->internal_name);
+ }
}
release_spnego_ctx(&sc);
} else if (ret != GSS_S_CONTINUE_NEEDED) {
Index: src/lib/gssapi/spnego/spnego_mech.c
===================================================================
--- src/lib/gssapi/spnego/spnego_mech.c (revision 23762)
+++ src/lib/gssapi/spnego/spnego_mech.c (working copy)
@@ -1739,9 +1739,12 @@
}
if (ret == GSS_S_COMPLETE) {
*context_handle = (gss_ctx_id_t)sc->ctx_handle;
- if (sc->internal_name != GSS_C_NO_NAME &&
- src_name != NULL) {
+ if (sc->internal_name != GSS_C_NO_NAME) {
+ if (src_name != NULL) {
*src_name = sc->internal_name;
+ } else {
+ gss_release_name(&tmpmin, &sc->internal_name);
+ }
}
release_spnego_ctx(&sc);
} else if (ret != GSS_S_CONTINUE_NEEDED) {