simulation mem leak - latch names array in create latch (#996)
* latch names array didn't free before
* do strdup for two unincluded names in freeing and free all of them
* remove extra comment
diff --git a/ODIN_II/SRC/read_blif.cpp b/ODIN_II/SRC/read_blif.cpp
index 849a888..d4ab387 100644
--- a/ODIN_II/SRC/read_blif.cpp
+++ b/ODIN_II/SRC/read_blif.cpp
@@ -368,12 +368,12 @@
/* add names and type information to the created input pins */
npin_t *new_pin = allocate_npin();
- new_pin->name = names[0];
+ new_pin->name = vtr::strdup(names[0]);
new_pin->type = INPUT;
add_input_pin_to_node(new_node, new_pin,0);
new_pin = allocate_npin();
- new_pin->name = names[3];
+ new_pin->name = vtr::strdup(names[3]);
new_pin->type = INPUT;
add_input_pin_to_node(new_node, new_pin,1);
@@ -399,6 +399,9 @@
output_nets_hash->add(new_node->name, new_net);
/* Free the char** names */
+ for (i = 0; i < input_token_count; i++)
+ vtr::free(names[i]);
+
vtr::free(names);
vtr::free(ptr);
}