All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Luc Herren <jlh@gmx.ch>
To: Jim Meyering <jim@meyering.net>, git list <git@vger.kernel.org>
Subject: Re: [PATCH] Remove useless if-before-free tests.
Date: Mon, 18 Feb 2008 15:27:24 +0100	[thread overview]
Message-ID: <47B995CC.2000809@gmx.ch> (raw)
In-Reply-To: <871w7bz1ly.fsf@rho.meyering.net>

Jim Meyering wrote:
> This change removes all useless if-before-free tests.
> E.g., it replace code like this
> 
> 	if (some_expression)
> 		free (some_expression);
> 
> with the now-equivalent
> 
> 	free (some_expression);

While you're at it, you might want to add this to your patch:

diff --git a/imap-send.c b/imap-send.c
index 9025d9a..3b27bca 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -472,7 +472,7 @@ v_issue_imap_cmd( imap_store_t *ctx, struct imap_cmd_cb *cb,
        if (socket_write( &imap->buf.sock, buf, bufl ) != bufl) {
                free( cmd->cmd );
                free( cmd );
-               if (cb && cb->data)
+               if (cb)
                        free( cb->data );
                return NULL;
        }

jlh

  parent reply	other threads:[~2008-02-18 14:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-17 21:58 [PATCH] Remove useless if-before-free tests Jim Meyering
2008-02-17 22:09 ` David Symonds
2008-02-18  9:18   ` Jim Meyering
2008-02-18  9:36     ` Junio C Hamano
2008-02-17 22:16 ` Johannes Schindelin
2008-02-18  9:01   ` Jim Meyering
2008-02-18 14:27 ` Jean-Luc Herren [this message]
2008-02-20 10:26   ` Jim Meyering
2008-02-22 17:18     ` Junio C Hamano
2008-02-22 17:35       ` Jim Meyering
2008-02-22 17:40         ` Junio C Hamano
2008-02-22 22:08           ` Jim Meyering
2008-02-22 23:05             ` Junio C Hamano
2008-02-24 18:15               ` Jim Meyering
2009-02-26 13:48                 ` Mike Ralphson
2008-02-26  6:59               ` Uwe Kleine-König
2008-02-23 13:30             ` Morten Welinder
2008-02-24 10:06               ` Johannes Schindelin
  -- strict thread matches above, loose matches on Subject: below --
2009-02-23 17:07 [PATCH] remove " Jim Meyering
2009-03-09  0:40 ` Theodore Tso

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=47B995CC.2000809@gmx.ch \
    --to=jlh@gmx.ch \
    --cc=git@vger.kernel.org \
    --cc=jim@meyering.net \
    /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.