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

Avoid passing 'size=0' to memalign #26645

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bradcray
Copy link
Member

@bradcray bradcray commented Feb 4, 2025

With our current version of valgrind (3.20.0), we're getting a complaint about sending a size of 0 into memalign(). This PR addresses that by:

  • having our memalign wrapper return 'NULL' if a size of 0 is passsed in rather than calling memalign()
  • updating the post-malloc checks to avoid calling them when the returned pointer is NULL if the size was 0

With our current version of valgrind (3.20.0), we're getting a
complaint about sending a size of 0 into memalign().  This PR
addresses that by:

* having our memalign wrapper return 'NULL' if a size of 0 is
  passsed in rather than calling memalign()

* updating the post-malloc checks to avoid calling them when the
  returned pointer is NULL if the size was 0

---
Signed-off-by: Brad Chamberlain <[email protected]>
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.

1 participant