clear freed memory in u_free_impl to catch UAF earlier

This commit is contained in:
Evgeny committed 2026-05-30 20:03:33 +03:00
1 parent a02c474b94
commit 4e6d57e371
1 file changed
+2
+2
View File
@@ -233,6 +233,8 @@ void u_free_impl(void* ptr, const char* location) {
#endif
exit(EXIT_FAILURE);
}
uint32_t total = size + 12 + 2 * BOUNDARY_CHECK_SIZE + METADATA_SIZE;
memset(base, 0, total);
free(base);
}