summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/udp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udp.c b/src/udp.c
index 753e8ac..96e2e23 100644
--- a/src/udp.c
+++ b/src/udp.c
@@ -220,7 +220,7 @@ int udp_read(udp_socket_t* sock, u_int8_t* buf, u_int32_t len, udp_endpoint_t* r
int udp_write(udp_socket_t* sock, u_int8_t* buf, u_int32_t len)
{
- if(!sock)
+ if(!sock || !sock->remote_end_set_)
return -1;
socklen_t socklen = sizeof(sock->remote_end_);