[krbdev.mit.edu #2727] Memory leak in krb5_cc_resolve (double malloc of pfx)

Public Submitter via RT rt-comment at krbdev.mit.edu
Thu Sep 30 12:14:34 EDT 2004


There is a 7 byte memory leak (strlen("MEMORY")+1) when passing a cache
name that is formatted with the "type:" field.

I was doing this:

cc_resolve(ctx, "/tmp/myfile.cache", &cache) 

and all was fine.  But then I decided that a MEMORY cache best fit my
needs, so I tried:

cc_resolve(ctx, "MEMORY:/tmp/myfile.cache", &cache) 

And found a leak with valgrind.  Its the size of the type string, I then
found the dual allocation.

ccbase.c:110 allocates 7 bytes of memory

ccbase.c:127 allocates over the first allocation (in the case where my
prefix length is greater then 1).


More information about the krb5-bugs mailing list