From 268aefb54c2c1ae04070169a4db5371507b0d46b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 8 Dec 2012 17:51:22 +0100 Subject: Free socket before handshake if no address is set to avoid crash --- src/peer.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit v1.2.3