From: Andy Maloney Date: Fri, 23 Dec 2022 09:06:17 +0000 (-0500) Subject: whisper : fix mem leak on failure to load model (#318) X-Git-Tag: upstream/1.7.4~1680 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=62fee9a9cc1bf2cc8ca1d0c0a776bb0d392f482c;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp whisper : fix mem leak on failure to load model (#318) --- diff --git a/whisper.cpp b/whisper.cpp index 367aa2ec..3885977d 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -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; }