This and the above `malloc` should probably have comments explaining why they're explicitly checking for the 0-sized case.