Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
teddyh
4y ago
0 comments
Save
Share
According to GNU libc, malloc(0) can return
either
NULL or a valid
unique
pointer value which can later be passed to free(). You seem to imply that one or the other is definitely true.
0 comments
1 comments · 1 top-level
top
newest
oldest
jra_samba
4y ago
Yes. Write test code for glibc. You'll find it always returns one of the two. There is a reason for that.
1 more reply
j
/
k
navigate · click thread line to collapse