Replace xmalloc+memset(0) with xcalloc.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
8e44025925
commit
90321c106c
3
tag.c
3
tag.c
@ -19,8 +19,7 @@ struct tag *lookup_tag(const unsigned char *sha1)
|
||||
{
|
||||
struct object *obj = lookup_object(sha1);
|
||||
if (!obj) {
|
||||
struct tag *ret = xmalloc(sizeof(struct tag));
|
||||
memset(ret, 0, sizeof(struct tag));
|
||||
struct tag *ret = xcalloc(1, sizeof(struct tag));
|
||||
created_object(sha1, &ret->object);
|
||||
ret->object.type = tag_type;
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user