From: Andrey Okoshkin Date: Tue, 24 Oct 2017 15:15:05 +0000 (+0300) Subject: path.c: use xmalloc() in add_to_trie() X-Git-Tag: v2.15.0~5^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55d7d15847e84d531f712f9fd6a7117283b208a3;p=thirdparty%2Fgit.git path.c: use xmalloc() in add_to_trie() Add usage of xmalloc() instead of malloc() in add_to_trie() as xmalloc wraps and checks memory allocation result. Signed-off-by: Andrey Okoshkin Signed-off-by: Junio C Hamano --- diff --git a/path.c b/path.c index 0349a0ab7b..9d518992d8 100644 --- a/path.c +++ b/path.c @@ -190,7 +190,7 @@ static void *add_to_trie(struct trie *root, const char *key, void *value) * Split this node: child will contain this node's * existing children. */ - child = malloc(sizeof(*child)); + child = xmalloc(sizeof(*child)); memcpy(child->children, root->children, sizeof(root->children)); child->len = root->len - i - 1;