Memory Leak problems with krb5_get_init_creds_password?

Sam Hartman hartmans at MIT.EDU
Mon Aug 22 18:45:18 EDT 2005


>>>>> "brian" == brian joh <brian.joh at comcast.net> writes:

    brian> Ken Raeburn wrote:

    >> We've run into other cases where a krb5_context is needed but
    >> other APIs make it difficult for one to be made available.  So
    >> there's code out there that allocates many short-lived
    >> krb5_context structures, often without using them for actual
    >> network stuff.

    brian> OK, thinking back, I can see how it might be difficult to
    brian> keep a krb5_context around in certain situations.

    brian> However, although I said the change I proposed would move
    brian> the "memory leak to krb5_init_context", this wasn't totally
    brian> accurate.  Basically, the memory leak would still occur
    brian> from the same place in the code (in the DNS SRV lookup code
    brian> apparently), but it would occur AT MOST once per
    brian> krb5_context.  Res_ninit() still gets called in exactly the
    brian> same spot, it just uses a PER krb5_context res_state
    brian> structure.  Then, res_ninit() apparently will deallocate
    brian> the structure, before initializing it again.

I'm not sure we have a desire to keep calling res_ninit multiple
times.

I think once per context might be acceptable actually.

this is my personal opinion though, not a decision on the issue.



More information about the Kerberos mailing list