projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c69c39
)
Make sure resolved addressed for outgoing connections are freed, if there are any.
author
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 29 Nov 2006 16:57:46 +0000
(16:57 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 29 Nov 2006 16:57:46 +0000
(16:57 +0000)
src/net.c
patch
|
blob
|
history
src/net_setup.c
patch
|
blob
|
history
diff --git
a/src/net.c
b/src/net.c
index e834f923593c7e1e6e0c3e4ffb2aceb493f64b8d..31f1b0e4ca0f07d03585af74d1231b62331b91dd 100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-463,7
+463,8
@@
int main_loop(void)
if(c->outgoing) {
free(c->outgoing->name);
- freeaddrinfo(c->outgoing->ai);
+ if(c->outgoing->ai)
+ freeaddrinfo(c->outgoing->ai);
free(c->outgoing);
c->outgoing = NULL;
}
diff --git
a/src/net_setup.c
b/src/net_setup.c
index ccd600b730c41816a49363f0e55464e74cd6f81d..f53127b5989085c5753018e8bb4eb9d7f020e503 100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-572,8
+572,14
@@
void close_network_connections(void)
next = node->next;
c = node->data;
- if(c->outgoing)
- free(c->outgoing->name), free(c->outgoing), c->outgoing = NULL;
+ if(c->outgoing) {
+ if(c->outgoing->ai)
+ freeaddrinfo(c->outgoing->ai);
+ free(c->outgoing->name);
+ free(c->outgoing);
+ c->outgoing = NULL;
+ }
+
terminate_connection(c, false);
}