Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'ao/path-use-xmalloc'
author
Junio C Hamano
<gitster@pobox.com>
Sat, 28 Oct 2017 01:18:39 +0000
(10:18 +0900)
committer
Junio C Hamano
<gitster@pobox.com>
Sat, 28 Oct 2017 01:18:40 +0000
(10:18 +0900)
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()
path.c
patch
|
blob
|
history
raw
(from parent 1:
2d8f12d
)
diff --git
a/path.c
b/path.c
index 2e09a7bce0688acccaca8b980c2c337a71885966..da8b655730d363dda5010bdf2d53bd76abb82931 100644
(file)
--- 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 =
x
malloc(sizeof(*child));
memcpy(child->children, root->children, sizeof(root->children));
child->len = root->len - i - 1;