krb5 commit: Fix memory leak in gss_add_cred

Greg Hudson ghudson at MIT.EDU
Thu Aug 30 13:09:14 EDT 2012


https://github.com/krb5/krb5/commit/b0b7eeb8ddb6fc3fde9bbebe9aa3069e7577e04c
commit b0b7eeb8ddb6fc3fde9bbebe9aa3069e7577e04c
Author: Greg Hudson <ghudson at mit.edu>
Date:   Thu Aug 30 13:08:34 2012 -0400

    Fix memory leak in gss_add_cred
    
    The most recent commit to g_acquire_cred.c allocates an OID set to
    pass to the mech, but never releases it.  Fix that.

 src/lib/gssapi/mechglue/g_acquire_cred.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/lib/gssapi/mechglue/g_acquire_cred.c b/src/lib/gssapi/mechglue/g_acquire_cred.c
index d228a77..bdfd464 100644
--- a/src/lib/gssapi/mechglue/g_acquire_cred.c
+++ b/src/lib/gssapi/mechglue/g_acquire_cred.c
@@ -540,6 +540,7 @@ gss_add_cred_from(minor_status, input_cred_handle,
 	(void) gssint_release_internal_name(&temp_minor_status,
 					   &mech->mech_type,
 					   &allocated_name);
+    (void) generic_gss_release_oid_set(&temp_minor_status, &target_mechs);
 
     return (GSS_S_COMPLETE);
 
@@ -560,5 +561,7 @@ errout:
     if (input_cred_handle == GSS_C_NO_CREDENTIAL && union_cred)
 	free(union_cred);
 
+    (void) generic_gss_release_oid_set(&temp_minor_status, &target_mechs);
+
     return (status);
 }


More information about the cvs-krb5 mailing list