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

Remove unnecessary assert on pointer created with new #555

Merged
merged 1 commit into from
Nov 20, 2020

Conversation

brawner
Copy link
Contributor

@brawner brawner commented Nov 19, 2020

This return path was flagged by clang static analysis as potentially leaking memory. I'm pretty sure it won't, but clang was a bit confused by it I think. In either case, new will throw an exception if it can't allocate instead of returning NULL.

Signed-off-by: Stephen Brawner brawner@gmail.com

Signed-off-by: Stephen Brawner <brawner@gmail.com>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with green CI.

@brawner
Copy link
Contributor Author

brawner commented Nov 19, 2020

Testing --packages-select rosidl_generator_cpp

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@brawner brawner merged commit 1458d50 into master Nov 20, 2020
@delete-merged-branch delete-merged-branch bot deleted the brawner/remove-assert-for-new branch November 20, 2020 23:48
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.

None yet

2 participants