mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-05 17:32:54 +03:00
coap-server.c: fixed memory leak in get_context()
When getaddrinfo() failed, the context object was not released before returning NULL. Coverity scan has detected this with CID 1458398.
This commit is contained in:
1 parent
29692faa86
commit
edca08249b
1 file changed
+1
@@ -358,6 +358,7 @@ get_context(const char *node, const char *port) {
|
||||
s = getaddrinfo(node, port, &hints, &result);
|
||||
if ( s != 0 ) {
|
||||
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(s));
|
||||
coap_free_context(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user