mirror of https://github.com/thesofproject/sof.git
tools: testbench: initialize pointer before freeing it
When we try to free a pointer which is not initialized, we are using a value in the program which is undefined. So, initialize the pointer variable, so that in future, when we free the pointer it won't cause a problem. Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
This commit is contained in:
parent
369e9e3b5a
commit
b1dec44124
|
@ -734,6 +734,9 @@ int parse_topology(struct sof *sof, struct shared_lib_table *library_table,
|
||||||
temp_comp_list = (struct comp_info *)
|
temp_comp_list = (struct comp_info *)
|
||||||
realloc(temp_comp_list, size);
|
realloc(temp_comp_list, size);
|
||||||
|
|
||||||
|
for (i = (num_comps - hdr->count); i < num_comps; i++)
|
||||||
|
temp_comp_list[i].name = NULL;
|
||||||
|
|
||||||
for (i = (num_comps - hdr->count); i < num_comps; i++) {
|
for (i = (num_comps - hdr->count); i < num_comps; i++) {
|
||||||
ret = load_widget(sof, SOF_DEV,
|
ret = load_widget(sof, SOF_DEV,
|
||||||
temp_comp_list,
|
temp_comp_list,
|
||||||
|
|
Loading…
Reference in New Issue