diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-05-16 19:19:04 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-05-16 19:19:14 +0300 |
commit | a7542b9e2b3cd2ecddbf6dfaddad9164a93720d4 (patch) | |
tree | 35e93b49c69a1c0220012729ee72c17a31fef194 /source | |
parent | 4878b29b498287ae1c3f0060bd13eb5927950e91 (diff) |
BLI_memarena: unpoison memory before freeing it
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/BLI_memarena.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index b5815f7b503..0f7ac92a348 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -77,6 +77,10 @@ static void memarena_buf_free_all(struct MemBuf *mb) { while (mb != NULL) { struct MemBuf *mb_next = mb->next; + + /* Unpoison memory because MEM_freeN might overwrite it. */ + ASAN_UNPOISON_MEMORY_REGION(mb, (uint)MEM_allocN_len(mb)); + MEM_freeN(mb); mb = mb_next; } |