Skip to content
Snippets Groups Projects
Commit f6c706c7 authored by Luigi Rizzo's avatar Luigi Rizzo
Browse files

make sure the argument to ast_malloc() is > 0.

Long explaination:

The behaviour of the underlying malloc(0) differs depending on the
operating system.  Some return NULL (SysV behaviour); some still
allocate a small chunk of memory and return a valid pointer (e.g.
traditional BSD); some (e.g. FreeBSD 6.x) return a non-null pointer
that causes a memory fault if used, even just for reading.

Given the above variety, better never call malloc(0).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48389 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 2c332f02
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment