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

NTP.stop() does not clear the UDP object properly #53

Open
naomai opened this issue Mar 28, 2024 · 0 comments
Open

NTP.stop() does not clear the UDP object properly #53

naomai opened this issue Mar 28, 2024 · 0 comments

Comments

@naomai
Copy link

naomai commented Mar 28, 2024

When calling NTP.begin() on client that was previously stopped with NTP.stop(), the device crashes.

NTPClient::stop only deallocates udp handle using udp_remove, but the pointer is not set to NULL.

if (udp) {
udp_remove (udp);
}

This causes the subsequent NTPClient::begin call to crash because of calling udp functions on deallocated udp_pcb

if (udp) {
DEBUGLOGI ("Remove UDP connection");
udp_disconnect (udp);
udp_remove (udp);
udp = NULL;
}

Thanks for creating a really helpful library!
Tomasz

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