Set edge->reverse to NULL before we free it

This commit is contained in:
thorkill 2015-07-06 01:04:11 +02:00
parent e51dd1b196
commit eda9f0ea8e

View file

@ -78,8 +78,11 @@ edge_t *new_edge(void) {
void free_edge(edge_t *e) {
sockaddrfree(&e->address);
sockaddrfree(&e->local_address);
if (e->reverse)
e->reverse = NULL;
free(e);
e = NULL;
}
void edge_add(edge_t *e) {
@ -155,7 +158,9 @@ bool dump_edges(connection_t *c) {
local_address, e->options, e->weight,
e->avg_rtt);
free(address);
address = NULL;
free(local_address);
local_address = NULL;
}
}