Make sure resolved addressed for outgoing connections are freed, if there are any.
This commit is contained in:
parent
5c69c390a1
commit
1bb5a284fe
2 changed files with 10 additions and 3 deletions
|
@ -463,7 +463,8 @@ int main_loop(void)
|
||||||
|
|
||||||
if(c->outgoing) {
|
if(c->outgoing) {
|
||||||
free(c->outgoing->name);
|
free(c->outgoing->name);
|
||||||
freeaddrinfo(c->outgoing->ai);
|
if(c->outgoing->ai)
|
||||||
|
freeaddrinfo(c->outgoing->ai);
|
||||||
free(c->outgoing);
|
free(c->outgoing);
|
||||||
c->outgoing = NULL;
|
c->outgoing = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -572,8 +572,14 @@ void close_network_connections(void)
|
||||||
next = node->next;
|
next = node->next;
|
||||||
c = node->data;
|
c = node->data;
|
||||||
|
|
||||||
if(c->outgoing)
|
if(c->outgoing) {
|
||||||
free(c->outgoing->name), free(c->outgoing), c->outgoing = NULL;
|
if(c->outgoing->ai)
|
||||||
|
freeaddrinfo(c->outgoing->ai);
|
||||||
|
free(c->outgoing->name);
|
||||||
|
free(c->outgoing);
|
||||||
|
c->outgoing = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
terminate_connection(c, false);
|
terminate_connection(c, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue