aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-11-18 11:14:00 -0800
committerJunio C Hamano <gitster@pobox.com>2011-11-18 11:14:00 -0800
commit79cfe0c5c4920bf68da548ad0d5bcdb425ce8d5f (patch)
tree9ae710ca2bcb33eca92ebcb1fff61b98d4e08194
parent01e0f162a70f61de0b7aa0e9d8c49c03cbafeb64 (diff)
parent74b531f65feaa09b5c3963f788b437a368933730 (diff)
downloadgit-79cfe0c5c4920bf68da548ad0d5bcdb425ce8d5f.tar.gz
git-79cfe0c5c4920bf68da548ad0d5bcdb425ce8d5f.tar.xz
Merge branch 'ml/mailmap' into maint
* ml/mailmap: mailmap: xcalloc mailmap_info Conflicts: mailmap.c
-rw-r--r--mailmap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mailmap.c b/mailmap.c
index 02fcfde0b..8c3196c7d 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -70,8 +70,7 @@ static void add_mapping(struct string_list *map,
} else {
/* create mailmap entry */
struct string_list_item *item = string_list_insert_at_index(map, index, old_email);
- item->util = xmalloc(sizeof(struct mailmap_entry));
- memset(item->util, 0, sizeof(struct mailmap_entry));
+ item->util = xcalloc(1, sizeof(struct mailmap_entry));
((struct mailmap_entry *)item->util)->namemap.strdup_strings = 1;
}
me = (struct mailmap_entry *)map->items[index].util;
@@ -88,7 +87,7 @@ static void add_mapping(struct string_list *map,
me->email = xstrdup(new_email);
}
} else {
- struct mailmap_info *mi = xmalloc(sizeof(struct mailmap_info));
+ struct mailmap_info *mi = xcalloc(1, sizeof(struct mailmap_info));
debug_mm("mailmap: adding (complex) entry for %s at index %d\n", old_email, index);
if (new_name)
mi->name = xstrdup(new_name);