commit: use xstrdup() in get_merge_parent()
Handle allocation errors for the name member just like we already do for the struct merge_remote_desc itself. Signed-off-by: Rene Scharfe <l.s.r@web.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
e0c1ceafc5
commit
c089320cf6
2
commit.c
2
commit.c
@ -1589,7 +1589,7 @@ struct commit *get_merge_parent(const char *name)
|
|||||||
struct merge_remote_desc *desc;
|
struct merge_remote_desc *desc;
|
||||||
desc = xmalloc(sizeof(*desc));
|
desc = xmalloc(sizeof(*desc));
|
||||||
desc->obj = obj;
|
desc->obj = obj;
|
||||||
desc->name = strdup(name);
|
desc->name = xstrdup(name);
|
||||||
commit->util = desc;
|
commit->util = desc;
|
||||||
}
|
}
|
||||||
return commit;
|
return commit;
|
||||||
|
Loading…
Reference in New Issue
Block a user