whisper : fix mem leak on failure to load model (#318)

pull/322/head
Andy Maloney 2022-12-23 04:06:17 -05:00 committed by GitHub
parent 493d94130d
commit 62fee9a9cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -2235,6 +2235,7 @@ struct whisper_context * whisper_init(const char * path_model) {
if (!whisper_model_load(path_model, *ctx)) {
fprintf(stderr, "%s: failed to load model from '%s'\n", __func__, path_model);
delete ctx;
return nullptr;
}