[1756] in Moira

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

Re: changes to setpw.c

daemon@ATHENA.MIT.EDU (Ezra Peisach)
Mon Mar 19 16:40:35 2001

Message-Id: <10103192140.AA00763@kangaroo.mit.edu>
To: "David E. Tanner" <dtanner@mit.edu>
Cc: moiradev@mit.edu
In-Reply-To: Your message of "Mon, 19 Mar 2001 16:15:29 EST."
             <3.0.32.20010319161528.0119d008@po14.mit.edu> 
Date: Mon, 19 Mar 2001 16:40:27 EST
From: Ezra Peisach <epeisach@MIT.EDU>


Err - I take that back - you should probably always use free in this case
(with a test for NULL). 

You allocate the memory with malloc in krb5_mk_setpw_req - how do you know that
the krb5 library's malloc/free arena are the same as the application?

For that reason, I suggest the doing away of the krb5_fre_data_contents
calls...

There are inconsistancies in the code in terms of using free() for krb5
library allocations and krb5 library functions to free locally allocated
memory - which might come back to bite you later...

I am not sure, but we probably need an API for freeing
a returned sockaddr **..

Therefore... When you were cleaning up the code - you didn't make things worse,
but free the malloc arena point of view, you could do better...

	Ezra

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