esp-idf: esp_http_client MEMORY LEAKS (IDFGH-7651)
Environment
- Development Kit: ESP32-Wrover-Kit
- Kit version (for WroverKit/PicoKit/DevKitC): v3
- Core (if using chip or module): ESP32-Wrover
- IDF version (
git rev-parse --short HEADto get the commit id.): 4b91c82cc447640e5b61407e810f1d6f3eabd233 - Development Env: Make
- Operating System: Ubuntu
- Power Supply: USB
Problem Description
esp_http_client module has memory leaks after perform. After taking a look at the code i think it is related to headers or body data. Since i was able to perform against custom server with no response packages and no leaks.
Expected Behavior
No memory leaks
Actual Behavior
TEST CASE:
Running **HTTPREQUEST - send MEMORY LEAKS ON SIMPLE PERFORM … MALLOC_CAP_8BIT potential leak: Before 227324 bytes free, After 226620 bytes free (delta 704) MALLOC_CAP_32BIT potential leak: Before 289596 bytes free, After 288892 bytes free (delta 704) ./test_httprequest.c:205:**HTTPREQUEST - send MEMORY LEAKS ON SIMPLE PERFORM :PASS Test ran in 518ms
Steps to repropduce
Just write the test below, different servers have different deltas.
Code to reproduce this issue
TEST_CASE("**HTTPREQUEST - send MEMORY LEAKS ON SIMPLE PERFORM ", "[httprequest]")
{
esp_http_client_config_t config = {
.url="http://inmote.api.insite.com.co:3100/",
};
esp_http_client_handle_t client = esp_http_client_init(&config);
esp_http_client_perform(client);
esp_http_client_cleanup(client);
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 20 (4 by maintainers)
Hi,
after http post
I am calling
esp_http_client_cleanup(client)Here Is the code snippet I am using