diff options
| author | Qi Wang <interwq@gwu.edu> | 2026-03-03 11:55:23 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2026-03-09 12:35:39 +0000 |
| commit | 2c5cd07828ad76c332e3bedc29fc641809e85396 (patch) | |
| tree | 280b1f56c2d4c44a260cb02e7b4dbce8220ab87b | |
| parent | 5583b64f230fe0ea4e3d4bf4566205b521190fbb (diff) | |
rallocx path: only set errno on the realloc case.
PR: 291677
Obtained from: jemalloc (commit 83b075789b4239035931c1ee212576d00153bbf0)
Fixes: c43cad871720 ("jemalloc: Merge from jemalloc 5.3.0 vendor branch")
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/2059
| -rw-r--r-- | contrib/jemalloc/src/jemalloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/jemalloc/src/jemalloc.c b/contrib/jemalloc/src/jemalloc.c index 352c18870e0b..edf23b9801b4 100644 --- a/contrib/jemalloc/src/jemalloc.c +++ b/contrib/jemalloc/src/jemalloc.c @@ -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(); |
