From ec3dfda228318887b26274f72ecf050a21427421 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Fri, 19 Jun 2020 16:13:50 +0200 Subject: [PATCH] coap-server.c: Fix memory leak in hnd_put() Added missing coap_delete_string() for uri_path in case of an error return. This fixes CID 1483553. --- examples/coap-server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/coap-server.c b/examples/coap-server.c index 9e45c1b3..58687f6e 100644 --- a/examples/coap-server.c +++ b/examples/coap-server.c @@ -550,6 +550,7 @@ hnd_put(coap_context_t *ctx UNUSED_PARAM, } else { dynamic_count--; response->code = COAP_RESPONSE_CODE(500); + coap_delete_string(uri_path); return; } } else {