rallocx path: only set errno on the realloc case.
PR: 291677
Obtained from: jemalloc (commit 83b075789b4239035931c1ee212576d00153bbf0)
Fixes: c43cad8717 ("jemalloc: Merge from jemalloc 5.3.0 vendor branch")
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/2059
This commit is contained in:
@@ -3561,7 +3561,9 @@ do_rallocx(void *ptr, size_t size, int flags, bool is_realloc) {
|
||||
|
||||
return p;
|
||||
label_oom:
|
||||
set_errno(ENOMEM);
|
||||
if (is_realloc) {
|
||||
set_errno(ENOMEM);
|
||||
}
|
||||
if (config_xmalloc && unlikely(opt_xmalloc)) {
|
||||
malloc_write("<jemalloc>: Error in rallocx(): out of memory\n");
|
||||
abort();
|
||||
|
||||
Reference in New Issue
Block a user