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:
parent
5b3db098f7
commit
2465bdf493
@ -1230,10 +1230,8 @@ je_malloc_usable_size(const void *ptr)
|
||||
|
||||
if (config_ivsalloc)
|
||||
ret = ivsalloc(ptr);
|
||||
else {
|
||||
assert(ptr != NULL);
|
||||
ret = isalloc(ptr);
|
||||
}
|
||||
else
|
||||
ret = (ptr != NULL) ? isalloc(ptr) : 0;
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user