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()
This commit is contained in:
commit
fd052e4f9a
2
path.c
2
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;
|
||||
|
Loading…
Reference in New Issue
Block a user