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 <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e0c1cea commit c089320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)