mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
only disable aligned_alloc if malloc was replaced but it wasn't
it both malloc and aligned_alloc have been replaced but the internal aligned_alloc still gets called, the replacement is a wrapper of some sort. it's not clear if this usage should be officially supported, but it's at least a plausibly interesting debugging usage, and easy to do. it should not be relied upon unless it's documented as supported at some later time.
This commit is contained in:
parent
e9f4fd1185
commit
1fc67fc117
1 changed files with 2 additions and 1 deletions
|
@ -12,7 +12,8 @@ void *aligned_alloc(size_t align, size_t len)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (len > SIZE_MAX - align || __malloc_replaced) {
|
||||
if (len > SIZE_MAX - align ||
|
||||
(__malloc_replaced && !__aligned_alloc_replaced)) {
|
||||
errno = ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue