Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ports/atomvm_mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ struct platform_data {

static term make_atom(GlobalContext *global, const char *string)
{
int global_atom_index = globalcontext_insert_atom(global, (AtomString) string);
return term_from_atom_index(global_atom_index);
term new_atom = globalcontext_make_atom(global, string);
if (UNLIKELY(term_is_invalid_term(new_atom))) {
RAISE_ERROR(OUT_OF_MEMORY_ATOM);
}

return new_atom;
}

static term heap_create_tuple4(Heap *heap, term a, term b, term c, term d)
Expand Down