Skip Menu |
 

Subject: memory leak
Date: Fri, 1 Oct 2010 21:21:11 -0400
From: "Arlene Berry" <aberry@likewise.com>
To: <krb5-bugs@mit.edu>

We’ve got a report of memory being leaked in src/lib/gssapi/krb5/acquire_cred.c.  It looks like the problem is that kg_init_name is being called on names with KG_INIT_NAME_INTERN set but when kg_release_name is called on error paths there are no flags set.  This means that names are added to an internal database but never removed from it and the associated memory is never freed.  It looks like the version of this code in trunk has been refactored and multiple uses of kg_release_name have been replaced with a single use but both versions call it without flags.  Since this internal database is new to me I’m not certain I understand it’s purpose well enough to fix this.  Should the kg_release_name calls be changed to pass the flag?

Date: Wed, 6 Oct 2010 16:59:24 -0400
From: "Arlene Berry" <aberry@likewise.com>
To: <krb5-bugs@mit.edu>
Subject: [krbdev.mit.edu #6793] memory leak
RT-Send-Cc:

If I’m understanding things right, objects should only be added to the internal database if they are going to be passed out in output parameters.  Both instances of kg_init_name in acquire_cred.c are called on cred->name which is an internal object and which is not passed out.  I checked krb5_gss_release_cred which does not use KG_INIT_NAME_INTERN when releasing cred->name.  I also looked at krb5_gss_inquire_cred to see what it does and, if it passes back the name, it calls kg_duplicate_name with KG_INIT_NAME_INTERN set.  As best I can determine, cred->name is strictly an internal object and the kg_init_name calls on it should not set KG_INIT_NAME_INTERN.

From: ghudson@mit.edu
Subject: SVN Commit

In acquire_init_cred in the GSS krb5 mech, don't intern cred->name,
since it's not used as an output parameter. Fixes a memory leak.
Reported by aberry@likewise.com.


https://github.com/krb5/krb5/commit/6877bdbad15700eacb9d946809102507ca23e5d4
Commit By: ghudson
Revision: 24480
Changed Files:
U trunk/src/lib/gssapi/krb5/acquire_cred.c
From: tlyu@mit.edu
Subject: SVN Commit

pull up r24480 from trunk

------------------------------------------------------------------------
r24480 | ghudson | 2010-10-25 15:37:03 -0400 (Mon, 25 Oct 2010) | 8 lines

ticket: 6793
target_version: 1.9
tags: pullup

In acquire_init_cred in the GSS krb5 mech, don't intern cred->name,
since it's not used as an output parameter. Fixes a memory leak.
Reported by aberry@likewise.com.

https://github.com/krb5/krb5/commit/05eb037395eac91e1dc2bdc8398d9d0fa44faba1
Commit By: tlyu
Revision: 24496
Changed Files:
U branches/krb5-1-9/src/lib/gssapi/krb5/acquire_cred.c