mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-25 14:23:12 +00:00
Check for NULL ptr in malloc_usable_size().
Check for NULL ptr in malloc_usable_size(), rather than just asserting that ptr is non-NULL. This matches behavior of other implementations (e.g., glibc and tcmalloc).
This commit is contained in:
@@ -1230,10 +1230,8 @@ je_malloc_usable_size(const void *ptr)
|
|||||||
|
|
||||||
if (config_ivsalloc)
|
if (config_ivsalloc)
|
||||||
ret = ivsalloc(ptr);
|
ret = ivsalloc(ptr);
|
||||||
else {
|
else
|
||||||
assert(ptr != NULL);
|
ret = (ptr != NULL) ? isalloc(ptr) : 0;
|
||||||
ret = isalloc(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user