Skip to content

Commit 51ea344

Browse files
committed
WIP: ODIN_II leak fix temp_string
1 parent e084da1 commit 51ea344

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ODIN_II/SRC/netlist_create_from_ast.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ void create_top_output_nodes(ast_node_t* module, char *instance_name_prefix, STR
15291529
nnet_t* define_nets_with_driver(ast_node_t* var_declare, char *instance_name_prefix, STRING_CACHE_LIST *local_string_cache_list)
15301530
{
15311531
int i;
1532-
char *temp_string;
1532+
char *temp_string = NULL;
15331533
long sc_spot;
15341534
nnet_t *new_net = NULL;
15351535

@@ -1587,6 +1587,9 @@ nnet_t* define_nets_with_driver(ast_node_t* var_declare, char *instance_name_pre
15871587
error_message(NETLIST_ERROR, var_declare->children[0]->line_number, var_declare->children[0]->file_number,
15881588
"%s: name conflicts with Odin internal reference\n", temp_string);
15891589

1590+
vtr::free(temp_string);
1591+
temp_string = NULL;
1592+
15901593
local_param_table_sc->data[sc_spot] = (void *)new_node;
15911594

15921595
long new_address_max = (addr_max - addr_min + 1)*addr_chunk_size -1;

0 commit comments

Comments
 (0)