From: René Scharfe Date: Sat, 13 Aug 2016 12:09:49 +0000 (+0200) Subject: commit: use xstrdup() in get_merge_parent() X-Git-Tag: v2.10.0-rc1~6^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c089320cf616d7817a0662d3963ae8ea0c4bc62d;p=thirdparty%2Fgit.git 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 Reviewed-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/commit.c b/commit.c index 2a90e37519..dd955e3e29 100644 --- a/commit.c +++ b/commit.c @@ -1589,7 +1589,7 @@ struct commit *get_merge_parent(const char *name) struct merge_remote_desc *desc; desc = xmalloc(sizeof(*desc)); desc->obj = obj; - desc->name = strdup(name); + desc->name = xstrdup(name); commit->util = desc; } return commit;