Loading...
--- libmalloc/libmalloc-715.120.13/src/malloc_exclaves.c
+++ libmalloc/libmalloc-657.60.21/src/malloc_exclaves.c
@@ -27,9 +27,6 @@
 
 #define MAX_MALLOC_ZONES 2
 
-#define DEFAULT_MALLOC_ZONE_STRING "DefaultXzoneZone"
-#define DEFAULT_SANITIZER_ZONE_STRING "DefaultWrapperSanitizerZone"
-
 MALLOC_NOEXPORT
 unsigned int phys_ncpus = 0;
 
@@ -41,8 +38,6 @@
 malloc_zone_t ** __unsafe_indexable malloc_zones = _malloc_zones;
 
 bool malloc_sanitizer_enabled = false;
-
-
 #if __LIBLIBC_F_ASAN_INSTRUMENTATION
 static struct malloc_sanitizer_poison malloc_poison_default = {
 	.heap_allocate_poison = __asan_poison_heap_memory_alloc,
@@ -146,20 +141,15 @@
 	logical_ncpus = _liblibc_plat_num_cpus;
 	phys_ncpus = _liblibc_plat_num_cpus;
 
-
 	const unsigned malloc_debug_flags = MALLOC_ABORT_ON_CORRUPTION |
 			MALLOC_ABORT_ON_ERROR;
 	mfm_initialize();
-	malloc_zone_t *xzone = xzm_main_malloc_zone_create(malloc_debug_flags,
-			NULL, args, NULL);
-	_malloc_zone_register(xzone, true);
-	malloc_set_zone_name(xzone, DEFAULT_MALLOC_ZONE_STRING);
+	_malloc_zone_register(xzm_main_malloc_zone_create(malloc_debug_flags,
+			NULL, args, NULL), true);
 
 #if __LIBLIBC_F_ASAN_INSTRUMENTATION
 	if ((malloc_sanitizer_enabled = sanitizer_should_enable())) {
-		malloc_zone_t *sanitizer = sanitizer_create_zone(xzone);
-		_malloc_zone_register(sanitizer, true);
-		malloc_set_zone_name(sanitizer, DEFAULT_SANITIZER_ZONE_STRING);
+		_malloc_zone_register(sanitizer_create_zone(_malloc_zones[0]), true);
 	}
 #endif // __LIBLIBC_F_ASAN_INSTRUMENTATION
 }
@@ -419,7 +409,9 @@
 
 	zone = _find_registered_zone(ptr, &size, known_non_default);
 	if (!zone) {
-		malloc_report_pointer_was_not_allocated(MALLOC_REPORT_CRASH, ptr);
+		malloc_report(MALLOC_REPORT_DEBUG | MALLOC_REPORT_NOLOG,
+			"*** error for object %p: pointer being freed was not allocated\n",
+			ptr);
 	} else if (zone->free_definite_size) {
 		malloc_zone_free_definite_size(zone,
 			__unsafe_forge_bidi_indexable(void *, ptr, size), size);
@@ -491,8 +483,9 @@
 	} else {
 		zone = _find_registered_zone(old_ptr, NULL, false);
 		if (!zone) {
-			malloc_report_pointer_was_not_allocated(MALLOC_REPORT_CRASH,
-					in_ptr);
+			malloc_report(MALLOC_REPORT_CRASH,
+				"*** error for object %p: pointer being realloc'd was not allocated\n",
+				in_ptr);
 		} else {
 			retval = malloc_zone_realloc(zone, old_ptr, new_size);
 		}