coap-server.c: Fix memory leak in hnd_put()

hnd_put() creates a new string object for the request's URI path.
When the permittwed number of dynamic resources was exceeded, this
object must be released manually.

This fixed CID 1483553 reported by Coverity scan.
This commit is contained in:
Olaf Bergmann committed 2019-07-26 12:45:59 +02:00
1 parent b79a43de30
commit 3ec6dffbf1
1 file changed
+1
+1
View File
@@ -440,6 +440,7 @@ hnd_put(coap_context_t *ctx UNUSED_PARAM,
if (dynamic_count >= support_dynamic) {
/* Should have been caught in hnd_unknown_put() */
response->code = COAP_RESPONSE_CODE(406);
coap_delete_string(uri_path);
return;
}
dynamic_count++;