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)
|
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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user