-
Notifications
You must be signed in to change notification settings - Fork 3.4k
malloc(0) fails #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
$ cat null-malloc.c int test_malloc(int bytes) fprintf(stdout, "testing malloc(%d)...", bytes); return 1; int main(int argc, char *argv[]) ret = test_malloc(1); return ret; |
Fixed in e2c5a4d, thanks for the bug report. |
Confirmed, thanks! |
…128.2 (emscripten-core#120) [dotnet/main] Update dependencies from dotnet/arcade
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)?
The text was updated successfully, but these errors were encountered: