From 492a328227a227ae81afab8ea6446b2eec5842ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 16 Jun 2022 19:46:24 +0200 Subject: [PATCH] spa: audioconvert: free resampler resample::free() needs to be called in `impl_clear()` otherwise the resampler's private data is leaked when the audioconvert instance is destroyed. --- spa/plugins/audioconvert/audioconvert.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 23ac2429b..4a669bcb4 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -2559,6 +2559,10 @@ static int impl_clear(struct spa_handle *handle) free(this->scratch); free(this->tmp); free(this->tmp2); + + if (this->resample.free) + resample_free(&this->resample); + return 0; }