Skip to content

Commit fd052e4

Browse files
committed
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()
2 parents 2d8f12d + 55d7d15 commit fd052e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

path.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static void *add_to_trie(struct trie *root, const char *key, void *value)
192192
* Split this node: child will contain this node's
193193
* existing children.
194194
*/
195-
child = malloc(sizeof(*child));
195+
child = xmalloc(sizeof(*child));
196196
memcpy(child->children, root->children, sizeof(root->children));
197197

198198
child->len = root->len - i - 1;

0 commit comments

Comments
 (0)