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:
Olaf Bergmann committed 2020-02-12 13:28:39 +01:00
1 parent af841d3a91
commit fca966385e
1 file changed
+2
+2
View File
@@ -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);