diff --git a/cores/esp32/esp32-hal-ledc.c b/cores/esp32/esp32-hal-ledc.c index 5bee6deba4c..74aac1c463d 100644 --- a/cores/esp32/esp32-hal-ledc.c +++ b/cores/esp32/esp32-hal-ledc.c @@ -63,6 +63,7 @@ static bool ledcDetachBus(void * bus){ ledc_channel_handle_t handle = (ledc_channel_handle_t)bus; ledc_handle.used_channels &= ~(1UL << handle->channel); pinMatrixOutDetach(handle->pin, false, false); + free(handle); return true; }