mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-06 17:52:54 +03:00
coap-server.c: Immediate exit when no endpoints defined
get_context() creates a new context object and adds coap_endpoint_t objects for all listen addresses. The function now clears the context object and returns NULL when no endpoint was created, causing the server to exit immediately.
This commit is contained in:
1 parent
af841d3a91
commit
fca966385e
1 file changed
+2
@@ -1119,6 +1119,8 @@ get_context(const char *node, const char *port) {
|
||||
}
|
||||
|
||||
fprintf(stderr, "no context available for interface '%s'\n", node);
|
||||
coap_free_context(ctx);
|
||||
ctx = NULL;
|
||||
|
||||
finish:
|
||||
freeaddrinfo(result);
|
||||
|
||||
Reference in new issue
Block a user