LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0466-erts-Fix-debug_realloc-for-ptr-NULL.patch of Package erlang (Project home:Ledest:erlang:20)

From a64977f98e71aaf046dc81719459a8f9b03da90d Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Thu, 18 Oct 2018 23:11:31 +0200
Subject: [PATCH 01/29] erts: Fix debug_realloc for ptr==NULL

---
 erts/emulator/beam/erl_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.16.4