Return NULL from `sub_alloc` for zero size
When zero was passed for the size to `sub_alloc`, we were passing this size on to `malloc` or `calloc`, which is unusual enough that static analyzers warn about this (POSIX says that either NULL or a pointer will be returned). We'll instead just return NULL right away.
正在显示
请
注册
或者
登录
后发表评论