From: Junio C Hamano Date: Sat, 28 Oct 2017 01:18:39 +0000 (+0900) Subject: Merge branch 'ao/path-use-xmalloc' X-Git-Tag: v2.15.0~5 X-Git-Url: https://www.git.lorimer.id.au/gitweb.git/diff_plain/fd052e4f9abc2cf9ea54ea33e2b563c0e120a795?hp=2d8f12d28273487b620cbd796560bc284feeffda 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() --- 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;