Skip to content

Commit f5db2fc

Browse files
author
Jyri Sarha
committed
cmocka: volume: Fix memory leaks
Fix all memory leaks found from volume test when tests were run under Valgrind. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 66153c1 commit f5db2fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/cmocka/src/audio/volume/volume_process.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ int main(void)
315315
struct vol_test_parameters *parameters;
316316
uint32_t volume_values[] = {VOL_MAX, VOL_ZERO_DB, VOL_MINUS_80DB};
317317
int num_tests = ARRAY_SIZE(test_parameters) * ARRAY_SIZE(volume_values);
318-
int i, j;
318+
int i, j, ret;
319319

320320
parameters = test_calloc(num_tests, sizeof(struct vol_test_parameters));
321321
for (i = 0; i < ARRAY_SIZE(test_parameters); i++) {
@@ -338,5 +338,9 @@ int main(void)
338338

339339
cmocka_set_message_output(CM_OUTPUT_TAP);
340340

341-
return cmocka_run_group_tests(tests, NULL, NULL);
341+
ret = cmocka_run_group_tests(tests, NULL, NULL);
342+
343+
test_free(parameters);
344+
345+
return ret;
342346
}

0 commit comments

Comments
 (0)