Passing NULL to realloc() is the same as calling malloc(), so this makes sense. malloc(0) would probably also give you a block of some minimum size on most platforms instead of returning NULL.
oh! You're right, our free() shim is passing the pointer directly to realloc() without checking for NULL. I'll fix that! (Also TIL that free(NULL) does nothing--I was sure that would be a crash.)
Allocates heap space if ptr is NULL, else reallocates the given pointer. If size is zero, frees the given pointer.
I've just wasted countless hours trying to work out where my leak was coming from. I don't need that kind of extra stress in my life. I'm writing stuff for the Playdate for fun, not as a penance.