Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15
DORMANTno replies

[PATCH] mailmap: remove redundant check for freeing memory

From: Stefan Beller <hidden>
Date: 2016-06-15 22:58:27
Subsystem: the rest · Maintainer: Linus Torvalds

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 [off-list ref]
Helped-by: Thomas Rast [off-list ref]
Signed-off-by: Stefan Beller <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help