Skip to content

Commit

Permalink
Merge pull request #3 from jeremycline/master
Browse files Browse the repository at this point in the history
de-allocate entry via enif_free() when name allocation fails
  • Loading branch information
prefiks authored Jan 29, 2024
2 parents b87975f + d283e5c commit bdb5448
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c_src/mqtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ int register_tree(char *name, state_t *state) {

entry->name = enif_alloc(strlen(name) + 1);
if (!entry->name) {
free(entry);
enif_free(entry);
return ENOMEM;
}

Expand Down

0 comments on commit bdb5448

Please sign in to comment.