Skip to content

Commit c912c6a

Browse files
author
vincelasal
committed
Cleaned up 3 memory leaks in netlist_create_from_ast.c (line: 1369, 2800,
2971)
1 parent 403e85c commit c912c6a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ODIN_II/SRC/netlist_create_from_ast.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,7 @@ nnet_t* define_nets_with_driver(ast_node_t* var_declare, char *instance_name_pre
13661366
/* store the data which is an idx here */
13671367
output_nets_sc->data[sc_spot] = (void*)new_net;
13681368
new_net->name = temp_string;
1369+
free(temp_string);
13691370

13701371
/* Assign initial value to this net if it exists */
13711372
if(var_declare->types.variable.is_initialized){
@@ -2796,6 +2797,7 @@ signal_list_t *create_pins(ast_node_t* var_declare, char *name, char *instance_n
27962797
add_pin_to_signal_list(return_sig_list, new_pin);
27972798
}
27982799

2800+
free(pin_list);
27992801
return return_sig_list;
28002802
}
28012803

@@ -2967,6 +2969,7 @@ signal_list_t *assignment_alias(ast_node_t* assignment, char *instance_name_pref
29672969
add_pin_to_signal_list(we, get_one_pin(verilog_netlist));
29682970
add_input_port_to_implicit_memory(left_memory, we, "we2");
29692971

2972+
free(in_1);
29702973
in_1 = init_signal_list();
29712974
char *name = left->children[0]->types.identifier;
29722975
int i;

0 commit comments

Comments
 (0)