[16694] in Kerberos_V5_Development
Re: Coding practices proposals
daemon@ATHENA.MIT.EDU (Sam Hartman)
Thu Mar 17 18:49:03 2011
From: Sam Hartman <hartmans@mit.edu>
To: ghudson@mit.edu
Date: Thu, 17 Mar 2011 18:48:19 -0400
In-Reply-To: <201103172133.p2HLX28E020953@outgoing.mit.edu> (ghudson@mit.edu's
message of "Thu, 17 Mar 2011 17:33:02 -0400 (EDT)")
Message-ID: <tsltyf1xt1o.fsf@mit.edu>
MIME-Version: 1.0
Cc: krbdev@mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krbdev-bounces@mit.edu
I've been thinking a bit more about freeing things in the cleanup
handler rather than sooner.
I wonder if that's overly restrictive.
My assumption is that you want it to be easy to make sure that the value
is freed. Here are some situations where I'm not sure that makes sense:
* If you are using the iff-ladder style of cleanup and don't have gotos
it seems reasonable to free and null sooner
* If a pointer is going out of scope it seems reasonable to free. I
don't think we want to force things into top most scope just to clean
them up in a particular place
* If the value has fairly short life, for example it is an intermediate
used by one call.
--Sam
_______________________________________________
krbdev mailing list krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev