aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-10-18 23:11:31 +0200
committerSverker Eriksson <[email protected]>2018-10-19 19:44:50 +0200
commita64977f98e71aaf046dc81719459a8f9b03da90d (patch)
tree82ecac7aab256fa617e09ddcd676db9c74a483aa /erts/emulator/beam/erl_alloc.c
parentb5a62a61b9856c32dd66e651462419adead3fdac (diff)
downloadotp-a64977f98e71aaf046dc81719459a8f9b03da90d.tar.gz
otp-a64977f98e71aaf046dc81719459a8f9b03da90d.tar.bz2
otp-a64977f98e71aaf046dc81719459a8f9b03da90d.zip
erts: Fix debug_realloc for ptr==NULL
Diffstat (limited to 'erts/emulator/beam/erl_alloc.c')
-rw-r--r--erts/emulator/beam/erl_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c
index 36c46fd7aa..cd679e32b0 100644
--- a/erts/emulator/beam/erl_alloc.c
+++ b/erts/emulator/beam/erl_alloc.c
@@ -4041,7 +4041,7 @@ debug_realloc(ErtsAlcType_t type, void *extra, void *ptr, Uint size)
erts_hdbg_chk_blks();
#endif
- if (old_size > size)
+ if (ptr && old_size > size)
sys_memset((void *) (((char *) ptr) + size),
0xf,
sizeof(Uint) + old_size - size);