smalloc: don't mix malloc() and new char[]#1205
Merged
bnoordhuis merged 1 commit intonodejs:v1.xfrom Mar 19, 2015
Merged
Conversation
Contributor
|
Thanks. Can you add the following just below the LGTM |
Member
Author
|
Do you use the |
Contributor
|
I thought |
Member
Author
|
That's how I use it, yes. By the way, it looks like the buglet wasn't introduced until some time after 8f3f9f7; that commit uses only new and delete[]. |
Contributor
|
@bnoordhuis I've used "Fixes" for both linking issues and commits. Doesn't matter honestly. |
It's technically undefined behavior to mix malloc with delete[] and new char[] with free(). smalloc was using new char[] in one place and malloc() in another but in both cases the memory was freed with free(). PR-URL: nodejs#1205 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
ffe2506 to
2034137
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's technically undefined behavior to mix malloc with delete[] and
new char[] with free(). smalloc was using new char[] in one place and
malloc() in another but in both cases the memory was freed with free().
R=@trevnorris