You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm still relatively new to Pico and was trying to connect my Pico 2 W to my Wi-Fi so that it could act as a simple remote sensor.
I believe the provided example pico_w/wifi/http_client/example_http_client_util.c has a memory leak, which prevents it from making more than a few requests before exhausting the allocated protocol control blocks (PCB).
This issue wouldn't have appeared in the provided code as it only makes a few requests before exiting. However, if the example is adapted to a real project, the bug would prevent boards from making more than ~PBUF_POOL_SIZE number of requests.
A pbuf_free(p); should be added to the receiver function to free the buffer after use. Here is the fixed version:
I'm still relatively new to Pico and was trying to connect my Pico 2 W to my Wi-Fi so that it could act as a simple remote sensor.
I believe the provided example
pico_w/wifi/http_client/example_http_client_util.c
has a memory leak, which prevents it from making more than a few requests before exhausting the allocated protocol control blocks (PCB).This issue wouldn't have appeared in the provided code as it only makes a few requests before exiting. However, if the example is adapted to a real project, the bug would prevent boards from making more than ~PBUF_POOL_SIZE number of requests.
A
pbuf_free(p);
should be added to the receiver function to free the buffer after use. Here is the fixed version:Optionally, it can be added to the
internal_recv_fn
function to make it easier to swap in a custom receiver.The text was updated successfully, but these errors were encountered: