[476] in Kerberos-V5-bugs
Re: Minor detail
daemon@ATHENA.MIT.EDU (Theodore Ts'o)
Fri May 20 14:32:15 1994
Date: Fri, 20 May 94 14:31:39 EDT
From: tytso@MIT.EDU (Theodore Ts'o)
To: georgesr@wrq.com
Cc: krb5-bugs@MIT.EDU, georgesr@elmer.wrq.com
In-Reply-To: georges rahbani's message of Fri, 20 May 1994 10:57:41 -0700,
<9405201758.AA16576@MIT.EDU>
Date: Fri, 20 May 1994 10:57:41 -0700
From: georgesr@wrq.com (georges rahbani)
Thank you Ted for your reply. Following is my solution to the memory
problem. I don't know yet if this will work, I have at least a month work
before I get a chance to start testing.
What you have should work, although there's a much simpler solution:
retval = krb5_cc_retrieve_cred(ccache, fields, &mcreds, &ncreds);
if (retval == 0) {
krb5_free_cred_contents(&creds);
*creds = ncreds;
}
if (retval != KRB5_CC_NOTFOUND || options & KRB5_GC_CACHED)
return retval;
There's no need to call krb5_copy_creds(), only to free ncreds
afterwards.
* Another question:
in function krb5_get_in_tkt at arround line 145. there is a call to
allocate memory:
retval is set by a previouscall and it should be 0 (which is OK) If we
return this value, the caller may assume that the function succeeded and do
something not nice. Shouldn't this be NOMEM error?
Yes, it should be. This whole section of code has since been revamped,
because of memory leaks in get_in_tkt.c So that bug has already been
fixed. But thanks for checking with me!
- Ted