rallocx path: only set errno on the realloc case.

This commit is contained in:
Qi Wang 2024-04-05 11:33:55 -07:00 committed by Qi Wang
parent 5081c16bb4
commit 83b075789b

View file

@ -3498,7 +3498,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();