Given that the caller has to check the return anyway, why not use calloc() and fail gracefully ?