←back to thread

49 points ingve | 2 comments | | HN request time: 0.404s | source
Show context
AaronDinesh ◴[] No.44389347[source]
Why should it be allowed to return a valid pointers anyways? Surely it should always return NULL?
replies(5): >>44389371 #>>44389461 #>>44389531 #>>44390081 #>>44392719 #
1. Joker_vD ◴[] No.44389371[source]
For instance, because you are prohibited from passing NULL to e.g. memcpy and lots of other library functions from memory.h/string.h, even when you explicitly specify a size of 0.

Another use was to use it to mint unique cookies/addresses, but malloc(1) works for this just as well.

replies(1): >>44389611 #
2. TZubiri ◴[] No.44389611[source]
Mmmmh, cookies