SRA-VJTI / sra-board-component

ESP-IDF component for SRA Board
https://sravjti.in/sra-board-component/
MIT License
36 stars 20 forks source link

Calloc in adc.c not freed #38

Closed ombhilare999 closed 3 years ago

ombhilare999 commented 3 years ago

https://github.com/SRA-VJTI/sra-board-component/blob/a11b18b2f91b80a4b7a0e5ae5a1d5f1f89470699/src/adc.c#L50 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.

laukik-hase commented 3 years ago

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.

VedantParanjape commented 3 years ago

Fixed in 54f891743ec99e038edf0a5e08896fafe2f8e5c9

@laukik-hase Review this once