Commit 55d7d158 authored by Andrey Okoshkin's avatar Andrey Okoshkin Committed by Junio C Hamano

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: default avatarAndrey Okoshkin <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 42e6fde5
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment