[fix] Check return of malloc() in trie.c

This commit is contained in:
Federico Mena Quintero
2016-02-25 11:37:00 -06:00
parent 7371a88c53
commit e60ad47677

View File

@@ -1037,6 +1037,9 @@ trie_t *trie_read(FILE *file) {
unsigned char *buf;
size_t buf_size = num_nodes * sizeof(uint32_t) * 2;
buf = malloc(buf_size);
if (buf == NULL) {
goto exit_trie_created;
}
unsigned char *buf_ptr;