-
Notifications
You must be signed in to change notification settings - Fork 11.8k
tools : fix invalid free() #13436
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
tools : fix invalid free() #13436
Conversation
…uctor's call to llama_batch_free from causing an invalid free()
There are other ways to solve this if you don't want to zero out the entire llama_batch object. (eg track whether server_context::init() has been called, check in the destructor before calling llama_batch_free) |
I think the proper fix is to check if |
Both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that makes sense. I think this can be the temporary solution before we finally have the private batch API.
Co-authored-by: Xuan-Son Nguyen <[email protected]>
Added a constructor to server_context that initializes server_context::batch, preventing the destructor's call to llama_batch_free() from causing an invalid free().
Ran into this when bind() failed.