summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-28 10:18:39 +0900
committerJunio C Hamano <gitster@pobox.com>2017-10-28 10:18:40 +0900
commitfd052e4f9abc2cf9ea54ea33e2b563c0e120a795 (patch)
tree8f1ecc70d6d5a5af912526abb2fdf710963ef2a2 /path.c
parent2d8f12d28273487b620cbd796560bc284feeffda (diff)
parent55d7d15847e84d531f712f9fd6a7117283b208a3 (diff)
downloadgit-fd052e4f9abc2cf9ea54ea33e2b563c0e120a795.tar.gz
Merge branch 'ao/path-use-xmalloc'
A possible oom error is now caught as a fatal error, instead of continuing and dereferencing NULL. * ao/path-use-xmalloc: path.c: use xmalloc() in add_to_trie()
Diffstat (limited to 'path.c')
-rw-r--r--path.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/path.c b/path.c
index 2e09a7bce0..da8b655730 100644
--- a/path.c
+++ b/path.c
@@ -192,7 +192,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;