Skip to content

Commit f3c65a6

Browse files
committed
vad: free ggml buffer in whisper_vad_free
This commit frees the ggml buffer in the whisper_vad_free function to prevent memory leaks. Resolves: #3452
1 parent fd95ecc commit f3c65a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/whisper.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5421,6 +5421,9 @@ struct whisper_vad_segments * whisper_vad_segments_from_samples(
54215421

54225422
void whisper_vad_free(whisper_vad_context * ctx) {
54235423
if (ctx) {
5424+
if (ctx->buffer) {
5425+
ggml_backend_buffer_free(ctx->buffer);
5426+
}
54245427
for (ggml_context * context : ctx->model.ctxs) {
54255428
ggml_free(context);
54265429
}

0 commit comments

Comments
 (0)