Skip to content

Commit b495232

Browse files
author
Jyri Sarha
committed
cmocka: eq_iir and eq_fir: Fix test crash
Assign mod->stream_params to NULL aftere it is freed. If this is not done comp_free() tries to free it again couple of lines later, when it calls module_adapter_free(). Removing test_free(mod->stream_params) does not fix the issue because cmocka framework provided test_alloc() and test_free() are not equivalent to malloc() and free(). Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent cf01b6c commit b495232

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

test/cmocka/src/audio/eq_fir/eq_fir_process.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ static int teardown(void **state)
186186
test_free(mod->input_buffers);
187187
test_free(mod->output_buffers);
188188
test_free(mod->stream_params);
189+
mod->stream_params = NULL;
189190
test_free(td->params);
190191
free_test_source(td->source);
191192
free_test_sink(td->sink);

test/cmocka/src/audio/eq_iir/eq_iir_process.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ static int teardown(void **state)
185185
test_free(mod->input_buffers);
186186
test_free(mod->output_buffers);
187187
test_free(mod->stream_params);
188+
mod->stream_params = NULL;
188189
test_free(td->params);
189190
free_test_source(td->source);
190191
free_test_sink(td->sink);

0 commit comments

Comments
 (0)