All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: LTP <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] mtest01: free memory allocated
Date: Tue, 05 Jan 2010 10:18:19 +0800	[thread overview]
Message-ID: <4B42A16B.4000509@cn.fujitsu.com> (raw)
In-Reply-To: <ECC1F2A4-FC8C-4626-904B-F29FB9CB209E@gmail.com>

> 2. Unless the test exits the code block immediately, I'd definitely do:
> 
> if (mem)
>      free (mem);
> 
> to avoid making a bad free call.
> 

free(NULL) is valid.


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2010-01-05  2:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 12:55 [LTP] mtest01: free memory allocated Francesco RUNDO
2010-01-05  2:10 ` Garrett Cooper
2010-01-05  2:18   ` Li Zefan [this message]
2010-01-07 11:36   ` Subrata Modak
2010-01-07 17:50     ` Garrett Cooper
2010-01-11 13:50     ` Francesco RUNDO
2010-01-06  1:19 ` Jiri Palecek
2010-01-06  1:28   ` Henry Yei
2010-01-07  1:47     ` Jiri Palecek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B42A16B.4000509@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=yanegomi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.