SRA-VJTI/sra-board-component

Calloc in adc.c not freed

ombhilare999 opened this issue · 2 comments

adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t));

I guess this calloc should be freed.

Code was referred from ESP32 ADC example:
https://github.com/espressif/esp-idf/blob/master/examples/peripherals/adc/main/adc1_example_main.c
They haven't done anything for calloc, @VedantParanjape @laukik-hase kindly check once.

The struct which has been calloc'ed is used only in the function characterize_adc1(). So, rather than doing this, we can make a local struct instance. Do this and comment the rseults.

Fixed in 54f8917

@laukik-hase Review this once