Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing memory leak in req_setopt #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

vtunr
Copy link

@vtunr vtunr commented May 23, 2018

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.

vtunr added 2 commits May 23, 2018 10:39
Fixing memory leak when using req_setopt

Approved-by: Marcin Wilk <marcin@foobot.io>
@tuanpmt
Copy link
Owner

tuanpmt commented May 24, 2018

Thank @vtunr
This project is no longer supported, please refer to

https://github.com/espressif/esp-idf/tree/master/components/esp_http_client

@vtunr
Copy link
Author

vtunr commented May 24, 2018

Thanks, i didn't know it was on esp-idf yet.

I'll switch to it.

Tony

@skitsanos
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants