Use xmemdupz() in many places.
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
39bd2eb56a
commit
182af8343c
4
tag.c
4
tag.c
@ -68,9 +68,7 @@ int parse_tag_buffer(struct tag *item, void *data, unsigned long size)
|
||||
memcpy(type, type_line + 5, typelen);
|
||||
type[typelen] = '\0';
|
||||
taglen = sig_line - tag_line - strlen("tag \n");
|
||||
item->tag = xmalloc(taglen + 1);
|
||||
memcpy(item->tag, tag_line + 4, taglen);
|
||||
item->tag[taglen] = '\0';
|
||||
item->tag = xmemdupz(tag_line + 4, taglen);
|
||||
|
||||
if (!strcmp(type, blob_type)) {
|
||||
item->tagged = &lookup_blob(sha1)->object;
|
||||
|
Reference in New Issue
Block a user