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

Invalid use of free in tokenizer.cpp #134

Closed
fairydreaming opened this issue Nov 11, 2024 · 1 comment · Fixed by #135
Closed

Invalid use of free in tokenizer.cpp #134

fairydreaming opened this issue Nov 11, 2024 · 1 comment · Fixed by #135

Comments

@fairydreaming
Copy link

In tokenizer.cpp you have: char* str_buffer = new char[str_buffer_size];, but later there is: free(str_buffer). You should replace it with delete[] str_buffer.

There is also probindex = new ProbIndex[vocab_size]; freed with free(probindex);. You should replace it with delete[] probindex.

@b4rtaz
Copy link
Owner

b4rtaz commented Nov 11, 2024

@fairydreaming Thanks for the reporting a problem. I fixed this in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants