Skip to content

fix possible free of null in String #873

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
Oct 17, 2015
Merged

fix possible free of null in String #873

merged 1 commit into from
Oct 17, 2015

Conversation

Links2004
Copy link
Collaborator

No description provided.

@igrr
Copy link
Member

igrr commented Oct 9, 2015

The free() function deallocates the memory allocation pointed to by ptr. If ptr is a NULL pointer, no
 operation is performed.

@Links2004
Copy link
Collaborator Author

it will generate an error message when setDebugOutput is active.

@pgollor
Copy link
Contributor

pgollor commented Oct 11, 2015

Sorry for the question. But why we are using malloc and free and not new and delete. Malloc is for c and new is the better way in CPP to allocate memory.
Or am i wrong?

@Links2004
Copy link
Collaborator Author

and new and delete are implemented with malloc and free ;)
https://github.com/esp8266/Arduino/blob/esp8266/hardware/esp8266com/esp8266/cores/esp8266/abi.cpp#L28

@pgollor
Copy link
Contributor

pgollor commented Oct 12, 2015

thanks @Links2004 :)

@mangelajo
Copy link
Contributor

+1, let's avoid unnecessary error messages in debug if possible.

igrr added a commit that referenced this pull request Oct 17, 2015
fix possible free of null in String
@igrr igrr merged commit 65c86db into esp8266:esp8266 Oct 17, 2015
igrr added a commit that referenced this pull request Oct 29, 2015
fix possible free of null in String
@Links2004 Links2004 deleted the string_fix branch October 31, 2015 09:52
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

Successfully merging this pull request may close these issues.

4 participants