kripken/emscripten — Issue #120: malloc(0) fails
Author: rillian
Created: 2011-11-17 00:28:48+00:00
State: open

Zero-length malloc calls assert. Since libc tends to return a valid pointer in this case, it's not uncommon. I found this particular one with one of the libogg framing.c unit tests from issue #115.

Calls to malloc(0) do succeed with --dlmalloc, but it would be nice if it were generally supported. Just allocate one space on the stack like you would for malloc(1)?