malloc_object_size: avoid fault for invalid region
It's the region pointer that can be NULL here, and p was checked at the beginning of the function.pull/132/head
parent
76860c72e1
commit
1984cb3b3d
|
@ -1690,7 +1690,7 @@ EXPORT size_t h_malloc_object_size(void *p) {
|
||||||
struct region_allocator *ra = ro.region_allocator;
|
struct region_allocator *ra = ro.region_allocator;
|
||||||
mutex_lock(&ra->lock);
|
mutex_lock(&ra->lock);
|
||||||
struct region_metadata *region = regions_find(p);
|
struct region_metadata *region = regions_find(p);
|
||||||
size_t size = p == NULL ? SIZE_MAX : region->size;
|
size_t size = region == NULL ? SIZE_MAX : region->size;
|
||||||
mutex_unlock(&ra->lock);
|
mutex_unlock(&ra->lock);
|
||||||
|
|
||||||
thread_seal_metadata();
|
thread_seal_metadata();
|
||||||
|
|
Loading…
Reference in New Issue