esp-request
esp-request copied to clipboard
Fixing memory leak in req_setopt
A memory leak could happen if req was null or there was no data when call req_setopt, because it was returning after the malloc.
Moving the malloc after the check solves the issue.
Thank @vtunr This project is no longer supported, please refer to
https://github.com/espressif/esp-idf/tree/master/components/esp_http_client
Thanks, i didn't know it was on esp-idf yet.
I'll switch to it.
Tony
esp_http_client is too heavy for simple tasks and has memory issues as well by the way...
@tuanpmt Tuan, thanks for sharing anyway.
@vtunr Tony, your fix seems working. I will leave code running for an hour to see if it is stable... i have http tasks coming every 5 seconds... will ping u with results.