[19493] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: Need to _kt_close() after _kt_default() ?

daemon@ATHENA.MIT.EDU (Greg Hudson)
Sat Sep 17 15:24:21 2016

To: Rick van Rein <rick@openfortress.nl>, krbdev@mit.edu
From: Greg Hudson <ghudson@mit.edu>
Message-ID: <2adbc42f-b880-fd19-87f5-4dac7a201812@mit.edu>
Date: Sat, 17 Sep 2016 15:23:59 -0400
MIME-Version: 1.0
In-Reply-To: <57DD29CC.7080806@openfortress.nl>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krbdev-bounces@mit.edu

On 09/17/2016 07:32 AM, Rick van Rein wrote:
> According to the krb5 API description for krb5_kt_default(), "The key
> table is not opened."
> 
> Still, valgrind reports a memory leak in my program, and points back to
> a calloc() inside krb5_kt_default().  When I call krb5_kt_close() on the
> keytab this leak is gone.
> 
> Might this be a glitch in the documentation, or elsewhere?

You definitely need to krb5_kt_close() the handle.

"The key table is not opened" is probably trying to convey that the
keytab file is not opened (for a FILE keytab), meaning that the call
will succeed if the keytab file doesn't exist.  The documentation should
be clearer.  (One could argue that a generic keytab function shouldn't
talk about the behavior of the FILE keytab type at all, but then where
in the API documentation does that go?)
_______________________________________________
krbdev mailing list             krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev

home help back first fref pref prev next nref lref last post