Skip to content

Commit 2e6dca1

Browse files
committed
do strdup for two unincluded names in freeing and free all of them
1 parent 69b53bd commit 2e6dca1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ODIN_II/SRC/read_blif.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,12 @@ void create_latch_node_and_driver(FILE *file, Hashtable *output_nets_hash)
368368

369369
/* add names and type information to the created input pins */
370370
npin_t *new_pin = allocate_npin();
371-
new_pin->name = names[0];
371+
new_pin->name = vtr::strdup(names[0]);
372372
new_pin->type = INPUT;
373373
add_input_pin_to_node(new_node, new_pin,0);
374374

375375
new_pin = allocate_npin();
376-
new_pin->name = names[3];
376+
new_pin->name = vtr::strdup(names[3]);
377377
new_pin->type = INPUT;
378378
add_input_pin_to_node(new_node, new_pin,1);
379379

@@ -401,8 +401,7 @@ void create_latch_node_and_driver(FILE *file, Hashtable *output_nets_hash)
401401
/* Free the char** names */
402402
for (i = 0; i < input_token_count; i++)
403403
// Except these two since they were assigned to new_node
404-
if (i!=0 && i!=3)
405-
vtr::free(names[i]);
404+
vtr::free(names[i]);
406405

407406
vtr::free(names);
408407
vtr::free(ptr);

0 commit comments

Comments
 (0)