Skip to content

Commit d5d990e

Browse files
authored
Merge pull request #736 from j-b-1-7/odin_leak_sub_not_node
Odin leak in subtractions.cpp not_node[i]
2 parents 42da0b4 + 01fede1 commit d5d990e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ODIN_II/SRC/subtractions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ void instantiate_hard_adder_subtraction(nnode_t *node, short mark, netlist_t * /
140140

141141
if (len <= sanity) /* buffer not large enough */
142142
oassert(false);
143-
144-
if(new_name)
145-
vtr::free(new_name);
143+
146144
/* Give names to the output pins */
147145
for (i = 0; i < node->num_output_pins; i++)
148146
{
@@ -398,10 +396,12 @@ void split_adder_for_sub(nnode_t *nodeo, int a, int b, int sizea, int sizeb, int
398396
for(i = 0; i < b; i++)
399397
{
400398
not_node[i] = allocate_nnode();
399+
nnode_t *temp = not_node[i];
401400
if(nodeo->num_input_port_sizes == 2)
402401
not_node[i] = make_not_gate_with_input(nodeo->input_pins[a + i], not_node[i], -1);
403402
else
404403
not_node[i] = make_not_gate_with_input(nodeo->input_pins[i], not_node[i], -1);
404+
free_nnode(temp);
405405
}
406406

407407
for(i = 0; i < count; i++)

0 commit comments

Comments
 (0)