summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-12-08 17:51:22 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-12-08 17:51:22 +0100
commit268aefb54c2c1ae04070169a4db5371507b0d46b (patch)
treec1d39141da80525983387b8cf336241970a72cb7 /src
parent9a155e4c51e7c6af96b73a4e6e8e17ed37ee4532 (diff)
downloadfastd-268aefb54c2c1ae04070169a4db5371507b0d46b.tar
fastd-268aefb54c2c1ae04070169a4db5371507b0d46b.zip
Free socket before handshake if no address is set to avoid crash
Diffstat (limited to 'src')
-rw-r--r--src/peer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/peer.c b/src/peer.c
index e2ddf22..9acedcb 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -169,6 +169,11 @@ static bool has_group_config_constraints(const fastd_peer_group_config *group) {
}
void fastd_peer_reset_socket(fastd_context *ctx, fastd_peer *peer) {
+ if (peer->address.sa.sa_family == AF_UNSPEC) {
+ free_socket(ctx, peer);
+ return;
+ }
+
if (!fastd_peer_is_socket_dynamic(peer))
return;