Skip to content

Commit bbd87a2

Browse files
committed
fixup! Add support to new atom chunk format introduced with OTP-28
1 parent b193643 commit bbd87a2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libAtomVM/atom_table.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,11 @@ int atom_table_ensure_atoms(struct AtomTable *table, const void *atoms, int coun
542542

543543
if (is_long_format) {
544544
uint8_t *atom_copy = malloc(atom_len + 1);
545+
if (IS_NULL_PTR(atom_copy)) {
546+
// we are not going to remove atoms that have already been added up to this one
547+
SMP_UNLOCK(table);
548+
return ATOM_TABLE_ALLOC_FAIL;
549+
}
545550
atom_copy[0] = atom_len;
546551
memcpy(atom_copy + 1, to_be_copied, atom_len);
547552
current_atom = atom_copy;

0 commit comments

Comments
 (0)