Skip to content

Comments

Fixing memory leak in req_setopt#20

Open
vtunr wants to merge 2 commits intotuanpmt:masterfrom
vtunr:master
Open

Fixing memory leak in req_setopt#20
vtunr wants to merge 2 commits intotuanpmt:masterfrom
vtunr:master

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