Free Some Unfreed Memory
diff --git a/nlsr.c b/nlsr.c
index 7eadb85..a30c016 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -1290,7 +1290,7 @@
nlsr=(struct nlsr *)calloc(1,sizeof(struct nlsr));
- nlsr->adl=hashtb_create(sizeof(struct ndn_neighbor), NULL);
+ nlsr->adl= hashtb_create(sizeof(struct ndn_neighbor), NULL);
nlsr->npl = hashtb_create(sizeof(struct name_prefix_list_entry), NULL);
nlsr->npt = hashtb_create(sizeof(struct npt_entry), NULL);
nlsr->routing_table = hashtb_create(sizeof(struct routing_table_entry), NULL);
diff --git a/nlsr_route.c b/nlsr_route.c
index 9c3b80b..cea17bb 100644
--- a/nlsr_route.c
+++ b/nlsr_route.c
@@ -48,9 +48,7 @@
{
/* Calculate Route here */
print_routing_table();
- print_npt();
-
- //struct hashtb_param param_me = {0};
+ print_npt();
nlsr->map = hashtb_create(sizeof(struct map_entry), NULL);
nlsr->rev_map = hashtb_create(sizeof(struct map_entry), NULL);
make_map();
@@ -194,8 +192,6 @@
free(adj_matrix);
destroy_map();
destroy_rev_map();
- //hashtb_destroy(&nlsr->map);
- //hashtb_destroy(&nlsr->rev_map);
}
nlsr->is_route_calculation_scheduled=0;
@@ -1464,6 +1460,8 @@
hashtb_end(e);
+ hashtb_destroy(&nlsr->map);
+
}
void
@@ -1486,4 +1484,6 @@
}
hashtb_end(e);
+
+ hashtb_destroy(&nlsr->rev_map);
}