Skip to content

Memory leak #1672

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

Merged
merged 1 commit into from
Jul 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Memory leak
When a package of size 0 arrives, "buf" is created, but never released. (Sorry, that was my mistake in the last patch)
  • Loading branch information
Schuemi authored Jul 25, 2018
commit 88936b95a55b38730f5c4f3413e5b3c956931847
7 changes: 4 additions & 3 deletions libraries/WiFi/src/WiFiUdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ int WiFiUDP::parsePacket(){
}
remote_ip = IPAddress(si_other.sin_addr.s_addr);
remote_port = ntohs(si_other.sin_port);
if (len == 0) return 0;
rx_buffer = new cbuf(len);
rx_buffer->write(buf, len);
if (len > 0) {
rx_buffer = new cbuf(len);
rx_buffer->write(buf, len);
}
delete[] buf;
return len;
}
Expand Down