[ENOMEM] Fix failure to check calloc return.

Fixes https://oss-fuzz.com/testcase-detail/6246465148813312.
This commit is contained in:
Garret Rieger 2020-07-29 12:33:42 -07:00 committed by Ebrahim Byagowi
parent d307c24abf
commit 4ba8e3c6fd
2 changed files with 2 additions and 0 deletions

View File

@ -215,6 +215,8 @@ struct name
this->count = it.len ();
NameRecord *name_records = (NameRecord *) calloc (it.len (), NameRecord::static_size);
if (unlikely (!name_records)) return_trace (false);
hb_array_t<NameRecord> records (name_records, it.len ());
for (const NameRecord& record : it)