Skip to content

Commit 1984cb3

Browse files
tsautereau-anssithestinger
authored andcommitted
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.
1 parent 76860c7 commit 1984cb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

h_malloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ EXPORT size_t h_malloc_object_size(void *p) {
16901690
struct region_allocator *ra = ro.region_allocator;
16911691
mutex_lock(&ra->lock);
16921692
struct region_metadata *region = regions_find(p);
1693-
size_t size = p == NULL ? SIZE_MAX : region->size;
1693+
size_t size = region == NULL ? SIZE_MAX : region->size;
16941694
mutex_unlock(&ra->lock);
16951695

16961696
thread_seal_metadata();

0 commit comments

Comments
 (0)