From c088d4abc5fc125e8b526b227a352f218aae1705 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Thu, 22 Dec 2022 17:21:00 -0500 Subject: [PATCH] whisper: Fix mem leak on failure to load model --- whisper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/whisper.cpp b/whisper.cpp index 367aa2e..3885977 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; }