Commit d0c246a
committed
Audio: MFCC: Fix memory leak on reset-prepare cycles
mfcc_reset() did not free buffers allocated by mfcc_setup(), so a
stop->reset->prepare->start cycle would leak all MFCC allocations
(FFT buffers, mel filterbank, DCT matrix, lifter, VAD buffers).
This patch fixes the issue by calling mfcc_free_buffers() from
mfcc_reset(). The pointers are set to NULL after free via a helper
function mfcc_free_and_null(), so mfcc_free() won't double-free
when it calls mfcc_free_buffers() again later.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>1 parent fc7322d commit d0c246a
2 files changed
Lines changed: 23 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
200 | 205 | | |
201 | 206 | | |
202 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
399 | 408 | | |
400 | 409 | | |
401 | 410 | | |
402 | 411 | | |
403 | 412 | | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
412 | 422 | | |
0 commit comments