Skip to content

Commit c089320

Browse files
rscharfegitster
authored andcommitted
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>
1 parent e0c1cea commit c089320

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ struct commit *get_merge_parent(const char *name)
15891589
struct merge_remote_desc *desc;
15901590
desc = xmalloc(sizeof(*desc));
15911591
desc->obj = obj;
1592-
desc->name = strdup(name);
1592+
desc->name = xstrdup(name);
15931593
commit->util = desc;
15941594
}
15951595
return commit;

0 commit comments

Comments
 (0)