The results of allocating zero bytes of memory are implementation-dependentdefined. According to C99 Section 7.20.3 ISO/IEC 9899-1999:
If the size of the space requested is zero, the behavior is implementation-defined: either a NULL pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object.
...