mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-06-14 12:58:10 +00:00
whisper : fix potential memory leaks (#740)
* fix potential memory leak if whisper_init_state failed * fix potential memory leak if gpt2_init failed
This commit is contained in:
committed by
GitHub
parent
7727a40dc9
commit
2c856fb9e5
@ -841,6 +841,7 @@ struct gpt2_context * gpt2_init(const char * path_model) {
|
||||
|
||||
if (!gpt2_model_load(path_model, ctx->model, ctx->vocab)) {
|
||||
fprintf(stderr, "%s: failed to load model from '%s'\n", __func__, "gpt-2.bin");
|
||||
delete ctx;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user