Open calvin2021y opened 3 months ago
This error only occurs when using musl; there are no issues with glibc.
this patch fix the problem
diff --git a/src/zbeacon.c b/src/zbeacon.c
index ee897406..ccff27a5 100644
--- a/src/zbeacon.c
+++ b/src/zbeacon.c
@@ -369,8 +369,12 @@ s_self_prepare_udp (self_t *self)
self->udpsock_send = INVALID_SOCKET;
}
- freeaddrinfo (bind_to);
- freeaddrinfo (send_to);
+ if( bind_to != NULL ) {
+ freeaddrinfo (bind_to);
+ }
+ if( send_to !=NULL && bind_to != send_to ) {
+ freeaddrinfo (send_to);
+ }
}
Isn't it that if send_to and bind_to are NULL we have some error state?
I am not sure about the details, just very without this fix it will crash with default test on some platform.
Can you then provide a PR?
If there no interface or only abnormal interface, linux: