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

Memory leak in SNTP sync #497

Open
ThomasNauwelaerts opened this issue Mar 21, 2019 · 3 comments
Open

Memory leak in SNTP sync #497

ThomasNauwelaerts opened this issue Mar 21, 2019 · 3 comments

Comments

@ThomasNauwelaerts
Copy link

int pico_sntp_sync(const char *sntp_server, void (*cb_synced)(pico_err_t status))

When performing a SNTP sync there is a memory leak of about 1k.
I'm at the latest version of the stack.

@ThomasNauwelaerts
Copy link
Author

ThomasNauwelaerts commented Mar 21, 2019

Edit: as the leakage remains when using pico_sntp_sync_ip, this has nothing to do with the pico_sntp_sync_start_dns_ipv4 routine.

@ThomasNauwelaerts
Copy link
Author

ThomasNauwelaerts commented Mar 22, 2019

Seems like in the function pico_sntp_client_wakeup we need to close the socket. Where else will the socket get closed?

PICO_FREE(recvbuf);

@frederikvs Could you verify this? Is it a solution to just add pico_socket_close(s); and pico_socket_del(s); to PICO_SOCK_EV_RD? Or do we need to close the socket in the other events also?

@ThomasNauwelaerts
Copy link
Author

@danielinux Maybe you could take a look at this?

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

No branches or pull requests

1 participant