Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token double free as error #300

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions core/lf_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ token_freed _lf_free_token(lf_token_t* token) {
// Recycle instead of freeing.
LF_PRINT_DEBUG("_lf_free_token: Putting token on the recycling bin: %p", token);
if (!hashset_add(_lf_token_recycling_bin, token)) {
lf_print_warning("Putting token %p on the recycling bin, but it is already there!", token);
lf_print_error_and_exit("Putting token %p on the recycling bin, but it is already there!", token);
}
} else {
// Recycling bin is full.
Expand Down Expand Up @@ -346,7 +346,7 @@ token_freed _lf_done_using(lf_token_t* token) {
}
LF_PRINT_DEBUG("_lf_done_using: token = %p, ref_count = %zu.", token, token->ref_count);
if (token->ref_count == 0) {
lf_print_warning("Token being freed that has already been freed: %p", token);
lf_print_error_and_exit("Token being freed that has already been freed: %p", token);
return NOT_FREED;
}
token->ref_count--;
Expand Down
Loading