summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2022-10-25 10:45:57 +1100
committerDaniel Black <daniel@mariadb.org>2022-10-25 10:46:05 +1100
commit436d19f845dba9077ca4e59df998b71ea92dcc10 (patch)
tree0fe682929dda1a06154386053e81768732e67c66
parentfe3d07cab82b2215dc64f52ac93122072c33d021 (diff)
downloadmariadb-git-bb-10.5-danielblack-my_free_undef.tar.gz
MDEV-XXX make my_free mark memory as MEM_UNDEFINEDbb-10.5-danielblack-my_free_undef
Allow MSAN/Valgrind to find memory that is reused without initialization.
-rw-r--r--mysys/my_malloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c
index befdcb0e5c3..90340053e4f 100644
--- a/mysys/my_malloc.c
+++ b/mysys/my_malloc.c
@@ -208,6 +208,8 @@ void my_free(void *ptr)
*/
TRASH_FREE(ptr, old_size);
#endif
+ MEM_UNDEFINED(ptr, old_size);
+
sf_free(mh);
DBUG_VOID_RETURN;
}