diff options
author | Sverker Eriksson <[email protected]> | 2018-10-15 15:55:13 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-10-15 15:55:13 +0200 |
commit | 1801a42d032bf43b1e7bdb54e03ec4617a80fb0d (patch) | |
tree | c0e11687c2191d3d388deeb64717c219f0a4e6ca | |
parent | 8018680cc1977ac2d70c070a5761cfe2db914821 (diff) | |
download | otp-1801a42d032bf43b1e7bdb54e03ec4617a80fb0d.tar.gz otp-1801a42d032bf43b1e7bdb54e03ec4617a80fb0d.tar.bz2 otp-1801a42d032bf43b1e7bdb54e03ec4617a80fb0d.zip |
erts: Fix bug in debug_free for NULL pointer
causing ASSERT in sys_memset to fail.
-rw-r--r-- | erts/emulator/beam/erl_alloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index 8fe1ccb758..9e36d5e0d1 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -4030,6 +4030,9 @@ debug_free(ErtsAlcType_t n, void *extra, void *ptr) ASSERT(ERTS_ALC_N_MIN <= n && n <= ERTS_ALC_N_MAX); + if (!ptr) + return; + dptr = check_memory_fence(ptr, &size, n, ERTS_ALC_O_FREE); #ifdef ERTS_ALC_A_EXEC |