[475] in Kerberos-V5-bugs
Minor detail
daemon@ATHENA.MIT.EDU (georges rahbani)
Fri May 20 13:59:06 1994
Date: Fri, 20 May 1994 10:57:41 -0700
To: krb5-bugs@MIT.EDU
From: georgesr@wrq.com (georges rahbani)
Cc: georgesr@elmer.wrq.com
Howdy,
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.
function get_credentials () ...
K5Creds nCreds;
...
res = K5_CC_RETRIEVE_CRED (ccache, fields, &mCreds, &nCreds);
if (!res)
{
// To clean up memory of creds previously allocated.
k5FreeCredContents (creds);
res = k5CopyCreds (&nCreds, creds);
if (res)
{
return res;
}
k5FreeCredContents (&nCreds);
}
Everything from here should work the same, since if retrieve is not
successful, get cred from kdc will clean up anyway.
--------
* Another question:
in function krb5_get_in_tkt at arround line 145. there is a call to
allocate memory:
request.padata = (krb5_pa_data **) malloc (sizeof (krb5_pa_data *) *2);
if (!request.padata) {
krb5_free_keyblock (decrypt_key);
return retval; // <------This line is of concern here
}
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?
PS> As you might have guessed, all my observation are by doing code
inspection since I still have some time to have a functional Kerberos client
that I can test. So pardon if these details are either not valid or things
that you have done already.
Regards,
GAR
Georges Rahbani
Walker, Richer & Quinn, Inc.
georgesr@wrq.com