Subject: Re: [PATCH] Remove useless if-before-free tests.

From: Jean-Luc Herren <[email-masked]>
Date: Mon, 18 Feb 2008 15:27:24 +0100

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