diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2025-10-18 19:07:08 +0200 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2025-10-18 19:07:08 +0200 |
| commit | 693ae7b71dfdd1a8146266b5794a71c0dbe5dff0 (patch) | |
| tree | 9704e2f7bd8962ea8911cd6f4e2d37227d7eff2e /tests/malloc.c | |
| parent | b8b9b0ac61ac47dddc58717f23619f8b06640498 (diff) | |
| parent | 27dae84ed92f1ef0300263091972338d12e78348 (diff) | |
Update upstream source from tag 'upstream/1.4.1'
Update to upstream version '1.4.1'
with Debian dir 8add41ffbfe3e6636eec0ec134c5af96832cc143
Diffstat (limited to 'tests/malloc.c')
| -rw-r--r-- | tests/malloc.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/malloc.c b/tests/malloc.c index 2a7867a1..5642c83c 100644 --- a/tests/malloc.c +++ b/tests/malloc.c @@ -1,6 +1,6 @@ /* malloc() function that is glibc compatible. - Copyright (C) 1997-1998, 2006-2007, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2006-2007, 2009-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -17,28 +17,33 @@ /* written by Jim Meyering and Bruno Haible */ +/* Ensure that we call the system's malloc() below. */ #define _GL_USE_STDLIB_ALLOC 1 #include <config.h> #include <stdlib.h> #include <errno.h> - -#include "xalloc-oversized.h" +#include <stdckdint.h> /* Allocate an N-byte block of memory from the heap, even if N is 0. */ void * rpl_malloc (size_t n) { +#if !HAVE_MALLOC_0_NONNULL if (n == 0) n = 1; +#endif - if (xalloc_oversized (n, 1)) +#if !HAVE_MALLOC_PTRDIFF + ptrdiff_t signed_n; + if (ckd_add (&signed_n, n, 0)) { errno = ENOMEM; return NULL; } +#endif void *result = malloc (n); |
