summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-08-13 14:09:49 +0200
committerJunio C Hamano <gitster@pobox.com>2016-08-13 19:47:49 -0700
commitc089320cf616d7817a0662d3963ae8ea0c4bc62d (patch)
tree01a1041dc85d2421d2ec7ffaa675533fd4f648dc
parente0c1ceafc5bece92d35773a75fff59497e1d9bd5 (diff)
downloadgit-c089320cf616d7817a0662d3963ae8ea0c4bc62d.tar.gz
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>
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
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;