At 1:11 PM -0600 12/18/00, Jacques A. Vidrine wrote:
>Ever notice that you tend to send more email when you should be
>studying for a final?

I did notice that I write very few letters now, compared to when
I was in college and still facing exams/finals...

>   /* Case 1 */                               /* Case 2 */
>   if (data)                 vs.              free(data)
>           free(data);
>
>I don't see that Case 1 obfuscates anything.  In some cases
>I find it clearer:  Case 1 implies that maybe no memory was
>allocated.  Case 2 seems to imply that memory was indeed
>allocated.

For what it's worth, my preference is to also zero out
'data' after freeing it.  I tend to do the 'if (data)'
part, particularly if I'm also doing that test for other
reasons.

-- 
Garance Alistair Drosehn            =   [EMAIL PROTECTED]
Senior Systems Programmer           or  [EMAIL PROTECTED]
Rensselaer Polytechnic Institute    or  [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to