Fix wrong pointer being checked for NULL in ternary

It's the region pointer that can be NULL here, and p was checked at the
beginning of the function.
This commit is contained in:
Thibaut Sautereau 2021-02-10 09:55:09 +01:00
parent e33365564b
commit 3c392a7fe7
No known key found for this signature in database
GPG key ID: AFB95DA3B1D60262

View file

@ -1693,7 +1693,7 @@ EXPORT size_t h_malloc_object_size(void *p) {
struct region_allocator *ra = ro.region_allocator;
mutex_lock(&ra->lock);
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);
thread_seal_metadata();