Skip to content
Snippets Groups Projects
Commit de667f2b authored by Dominik Loidolt's avatar Dominik Loidolt
Browse files

remove some memory leaks

parent 86c5b5bd
Branches
Tags
1 merge request!12increase code coverage, general code refactoring
......@@ -493,9 +493,14 @@ void compression_decompression(struct cmp_cfg *cfg)
int data_size, cmp_data_size;
struct cmp_entity *ent;
void *decompressed_data;
static void *model_of_data;
static void *model_of_data = NULL;
void *updated_model = NULL;
if (!cfg) {
free(model_of_data);
return;
}
TEST_ASSERT_NOT_NULL(cfg);
TEST_ASSERT_NULL(cfg->icu_output_buf);
......@@ -611,6 +616,7 @@ void test_random_compression_decompression(void)
free(data_to_compress2);
free(updated_model);
}
compression_decompression(NULL);
}
#define N_SAMPLES 5
......
......@@ -2740,6 +2740,9 @@ void test_compress_s_fx_raw(void)
TEST_ASSERT_EQUAL_HEX(data[i].exp_flags, p[i].exp_flags);
TEST_ASSERT_EQUAL_HEX(data[i].fx, cpu_to_be32(p[i].fx));
}
free(cfg.input_buf);
free(cfg.icu_output_buf);
}
......
......@@ -437,6 +437,8 @@ void test_cmp_decmp_s_fx_diff(void)
/* if (up_model[i] != de_up_model[i]) */
/* TEST_ASSERT(0); */
/* } */
free(ent);
free(decompressed_data);
}
#undef DATA_SAMPLES
......@@ -629,6 +631,7 @@ void test_s_fx_diff(void)
for (i = 0; i < s; ++i) {
TEST_ASSERT_EQUAL(result_data[i], decompressed_data[i]);
}
free(decompressed_data);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment