X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mailmap.c;h=02fcfde0b0b786af5229559586cf8ff5758429bc;hb=a31d066524e55351b385e34f9494f36e9f960a6c;hp=f80b701292f0d852950735ab20a63dac13e92362;hpb=af24059fa299f1656692f5807eddd3b30b5f3cfb;p=thirdparty%2Fgit.git diff --git a/mailmap.c b/mailmap.c index f80b701292..02fcfde0b0 100644 --- a/mailmap.c +++ b/mailmap.c @@ -79,12 +79,14 @@ static void add_mapping(struct string_list *map, if (old_name == NULL) { debug_mm("mailmap: adding (simple) entry for %s at index %d\n", old_email, index); /* Replace current name and new email for simple entry */ - free(me->name); - free(me->email); - if (new_name) + if (new_name) { + free(me->name); me->name = xstrdup(new_name); - if (new_email) + } + if (new_email) { + free(me->email); me->email = xstrdup(new_email); + } } else { struct mailmap_info *mi = xmalloc(sizeof(struct mailmap_info)); debug_mm("mailmap: adding (complex) entry for %s at index %d\n", old_email, index);