diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-12-08 17:51:22 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-12-08 17:51:22 +0100 |
commit | 268aefb54c2c1ae04070169a4db5371507b0d46b (patch) | |
tree | c1d39141da80525983387b8cf336241970a72cb7 /src/peer.c | |
parent | 9a155e4c51e7c6af96b73a4e6e8e17ed37ee4532 (diff) | |
download | fastd-268aefb54c2c1ae04070169a4db5371507b0d46b.tar fastd-268aefb54c2c1ae04070169a4db5371507b0d46b.zip |
Free socket before handshake if no address is set to avoid crash
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |