diff options
author | Andrey Okoshkin <a.okoshkin@samsung.com> | 2017-10-24 18:15:05 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-25 16:16:22 +0900 |
commit | 55d7d15847e84d531f712f9fd6a7117283b208a3 (patch) | |
tree | 5cdd03f2c2cb1734f1efcb63b7d482fc05a2e0e6 /path.c | |
parent | 42e6fde5c28150206956ea4be490d886c4ecbd68 (diff) | |
download | git-55d7d15847e84d531f712f9fd6a7117283b208a3.tar.gz |
path.c: use xmalloc() in add_to_trie()ao/path-use-xmalloc
Add usage of xmalloc() instead of malloc() in add_to_trie() as xmalloc wraps
and checks memory allocation result.
Signed-off-by: Andrey Okoshkin <a.okoshkin@samsung.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'path.c')
-rw-r--r-- | path.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |