mirror of
https://github.com/ollama/ollama.git
synced 2025-08-31 21:31:04 +02:00
llama: fix memory leak for grammar (#10696)
This commit is contained in:
3
llama/sampling_ext.cpp
vendored
3
llama/sampling_ext.cpp
vendored
@@ -114,6 +114,9 @@ void grammar_free(struct llama_grammar *g) {
|
|||||||
if (g->vocab != nullptr) {
|
if (g->vocab != nullptr) {
|
||||||
delete g->vocab;
|
delete g->vocab;
|
||||||
}
|
}
|
||||||
|
if (g->o_vocab != nullptr) {
|
||||||
|
delete g->o_vocab;
|
||||||
|
}
|
||||||
llama_grammar_free_impl(g);
|
llama_grammar_free_impl(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user