git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <stefanbeller@googlemail.com>
To: git@vger.kernel.org, peff@peff.net, gitster@pobox.com, trast@inf.ethz.ch
Cc: Stefan Beller <stefanbeller@googlemail.com>
Subject: [PATCH] mailmap: remove redundant check for freeing memory
Date: Tue, 20 Aug 2013 16:18:00 +0200	[thread overview]
Message-ID: <1377008280-17230-1-git-send-email-stefanbeller@googlemail.com> (raw)
In-Reply-To: <52137A63.3010609@googlemail.com>

The condition as it is written in that line has already been checked
in the beginning of the function, which was introduced in
8503ee4 (2007-05-01, Fix read_mailmap to handle a caller uninterested
in repo abbreviation)

Helped-by: Jeff King <peff@peff.net>
Helped-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
---
 mailmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mailmap.c b/mailmap.c
index 44614fc..7d5caa6 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -153,8 +153,7 @@ static void read_mailmap_line(struct string_list *map, char *buffer,
 		if (!strncmp(buffer, abbrev, abblen)) {
 			char *cp;
 
-			if (repo_abbrev)
-				free(*repo_abbrev);
+			free(*repo_abbrev);
 			*repo_abbrev = xmalloc(len);
 
 			for (cp = buffer + abblen; isspace(*cp); cp++)
-- 
1.8.4.rc3.1.gc1ebd90

  reply	other threads:[~2013-08-20 14:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-20 13:22 [PATCH] mailmap: fix check for freeing memory Stefan Beller
2013-08-20 13:40 ` Thomas Rast
2013-08-20 13:52   ` Jeff King
2013-08-20 14:17   ` Stefan Beller
2013-08-20 14:18     ` Stefan Beller [this message]
2013-08-20 14:28       ` [PATCH] mailmap: remove redundant " Jeff King
2013-08-20 14:23     ` [PATCH] mailmap: fix " Thomas Rast
2013-08-20 14:38       ` Stefan Beller
2013-08-20 16:12         ` Jeff King
2013-08-20 17:18           ` Junio C Hamano
2013-08-20 17:45             ` Jeff King
2013-08-20 14:27     ` Jeff King

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=1377008280-17230-1-git-send-email-stefanbeller@googlemail.com \
    --to=stefanbeller@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=trast@inf.ethz.ch \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).