-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Replace new with malloc for non-class calls #7868
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
Conversation
Given that all places that need changing are byte buffers, why not switch to malloc and free instead? |
I had the same thought. This PR will likely switch those lines to malloc but also resolve other potential |
I've decided to limit the scope of this PR to just replacing |
8ad0335
to
e346d55
Compare
Help needed: arduino-esp32/cores/esp32/Esp.cpp Line 224 in 0d84018
Why did this use unique_ptr ?
Reworked here: e20bcfa |
e20bcfa
to
ff21b99
Compare
|
@me-no-dev What about this PR? Is it still valid? |
Resolved possible crash in EspClass::getSketchMD5().
ff21b99
to
76c7fd8
Compare
Rebased PR on latest master. No conflicts. I'm open to suggestions on what parts of this PR you guys want to keep. We should at least include the crash fix from #8065 to WiFiUDP.cpp. In fact, why didn't the fix on the 2.x branch get added to 3.x? Is it because we were going to merge this PR instead? |
Yes :) |
Description of Change
This PR resolves potential crashing issues when allocating memory using
new
keyword. Will be replacing withmalloc
for non-class calls. Targeting 3.0.x branch.Tests scenarios
arduino-esp32 core v2.0.7 with Adafruit Feather ESP32.
Related links
Please provide links to related issue, PRs etc.
Started by issue #7558. PR #8065 will fix the issue on 2.x branch.