The condition as it is written in that line was most likely intended to check for the pointer passed to free(), rather than checking for the 'repo_abbrev', which is already checked against being non null at the beginning of the function. Signed-off-by: Stefan Beller <stefanbeller@xxxxxxxxxxxxxx> --- mailmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailmap.c b/mailmap.c index 44614fc..36d2a7a 100644 --- a/mailmap.c +++ b/mailmap.c @@ -139,35 +139,35 @@ static char *parse_name_and_email(char *buffer, char **name, static void read_mailmap_line(struct string_list *map, char *buffer, char **repo_abbrev) { char *name1 = NULL, *email1 = NULL, *name2 = NULL, *email2 = NULL; if (buffer[0] == '#') { static const char abbrev[] = "# repo-abbrev:"; int abblen = sizeof(abbrev) - 1; int len = strlen(buffer); if (!repo_abbrev) return; if (len && buffer[len - 1] == '\n') buffer[--len] = 0; if (!strncmp(buffer, abbrev, abblen)) { char *cp; - if (repo_abbrev) + if (*repo_abbrev) free(*repo_abbrev); *repo_abbrev = xmalloc(len); for (cp = buffer + abblen; isspace(*cp); cp++) ; /* nothing */ strcpy(*repo_abbrev, cp); } return; } if ((name2 = parse_name_and_email(buffer, &name1, &email1, 0)) != NULL) parse_name_and_email(name2, &name2, &email2, 1); if (email1) add_mapping(map, name1, email1, name2, email2); } static int read_mailmap_file(struct string_list *map, const char *filename, -- 1.8.4.rc3.1.gc1ebd90 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html