]> git.ipfire.org Git - thirdparty/freeswitch.git/commit
Return NULL from `sub_alloc` for zero size
authorTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2014 02:47:04 +0000 (02:47 +0000)
committerTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2014 02:47:04 +0000 (02:47 +0000)
commit3c32dd3bc92ccbcac538a25746f09ca68371319b
tree5d154a81ef97c7478b895978e802b3123aed025d
parent959e672a941cef2e2b6452772fdf990736192222
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.
libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c