A memory leak issue was discovered in the CoAP library of Arm Mbed OS when using the Arm mbed-coap library. The CoAP parser, specifically the function `sn coap parser options parse()`, is responsible for parsing received CoAP packets. Due to a lack of overflow detection, it is possible to craft a packet that wraps the option number around, resulting in the same option number being processed again in a single packet. Certain options, such as `COAP OPTION URI QUERY`, `COAP OPTION URI PATH`, `COAP OPTION LOCATION QUERY`, and `COAP OPTION ETAG`, allocate memory without checking if it has already been allocated, leading to multiple assignments of allocated memory to a single pointer and resulting in a memory leak by buffer orphaning.