Skip to content

Commit 44e389d

Browse files
committed
WIP: Fixed memory leak in assignment_alias function in netlist_creat_from_ast.cpp
1 parent a14e423 commit 44e389d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ODIN_II/SRC/netlist_create_from_ast.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,10 +3355,17 @@ signal_list_t *assignment_alias(ast_node_t* assignment, char *instance_name_pref
33553355
}
33563356
else
33573357
{
3358+
ast_node_t *temp = right;
3359+
33583360
right = resolve_node(NULL, instance_name_prefix, right);
33593361

33603362
in_1 = netlist_expand_ast_of_module(right, instance_name_prefix);
33613363
oassert(in_1 != NULL);
3364+
3365+
if(right != temp)
3366+
{
3367+
free_whole_tree(right);
3368+
}
33623369
}
33633370

33643371
char_list_t *out_list;

0 commit comments

Comments
 (0)