Skip to content

Commit fa584b4

Browse files
authored
whisper : fix mem leak on failure to load model (ggml-org#318)
1 parent 1f90e0c commit fa584b4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

whisper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,6 +2235,7 @@ struct whisper_context * whisper_init(const char * path_model) {
22352235

22362236
if (!whisper_model_load(path_model, *ctx)) {
22372237
fprintf(stderr, "%s: failed to load model from '%s'\n", __func__, path_model);
2238+
delete ctx;
22382239
return nullptr;
22392240
}
22402241

0 commit comments

Comments
 (0)