HomeFreeBSD

libc: handle zero alignment in memalign()

Description

libc: handle zero alignment in memalign()

For compatibility with glibc. The previous code would trigger a division
by zero in roundup() and terminate. Instead, just pass through to
malloc() for align == 0.

PR: 269688
Reviewed by: imp, mjg
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/655

(cherry picked from commit 2c709ee70ade9fd8f77b37917a4169d667dda41d)

Details

Provenance
pjfloyd_wanadoo.frAuthored on Feb 24 2023, 4:29 PM
emasteCommitted on Mar 3 2023, 12:23 AM
Parents
rG24fe8a518324: freebsd-update: avoid effects of user's environment on grep
Branches
Unknown
Tags
Unknown