summaryrefslogtreecommitdiffstats
path: root/gl/xmalloc.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-11-06 08:24:23 (GMT)
committerGitHub <noreply@github.com>2024-11-06 08:24:23 (GMT)
commit9b4df9e50837cc837e113053ba12ee6967d5e6c2 (patch)
treebf989e771579f835bcb49c074637a8e224bcecbc /gl/xmalloc.c
parent94150ae347beb25ac369d5773834ceef7f3736d3 (diff)
parent5be04ec2ceb1df77afbca4fcbf9e92a712612d6f (diff)
downloadmonitoring-plugins-9b4df9e50837cc837e113053ba12ee6967d5e6c2.tar.gz
Merge pull request #2037 from RincewindsHat/update/gnulib-1.0
Sync with the latest Gnulib code (d4ec02b3cc) (gnulib v1.0)
Diffstat (limited to 'gl/xmalloc.c')
-rw-r--r--gl/xmalloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gl/xmalloc.c b/gl/xmalloc.c
index 289cbd0..5befdab 100644
--- a/gl/xmalloc.c
+++ b/gl/xmalloc.c
@@ -1,6 +1,6 @@
1/* xmalloc.c -- malloc with out of memory checking 1/* xmalloc.c -- malloc with out of memory checking
2 2
3 Copyright (C) 1990-2000, 2002-2006, 2008-2023 Free Software Foundation, Inc. 3 Copyright (C) 1990-2000, 2002-2006, 2008-2024 Free Software Foundation, Inc.
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
30#include <string.h> 30#include <string.h>
31 31
32static void * _GL_ATTRIBUTE_PURE 32static void * _GL_ATTRIBUTE_PURE
33nonnull (void *p) 33check_nonnull (void *p)
34{ 34{
35 if (!p) 35 if (!p)
36 xalloc_die (); 36 xalloc_die ();
@@ -42,13 +42,13 @@ nonnull (void *p)
42void * 42void *
43xmalloc (size_t s) 43xmalloc (size_t s)
44{ 44{
45 return nonnull (malloc (s)); 45 return check_nonnull (malloc (s));
46} 46}
47 47
48void * 48void *
49ximalloc (idx_t s) 49ximalloc (idx_t s)
50{ 50{
51 return nonnull (imalloc (s)); 51 return check_nonnull (imalloc (s));
52} 52}
53 53
54char * 54char *
@@ -72,7 +72,7 @@ xrealloc (void *p, size_t s)
72void * 72void *
73xirealloc (void *p, idx_t s) 73xirealloc (void *p, idx_t s)
74{ 74{
75 return nonnull (irealloc (p, s)); 75 return check_nonnull (irealloc (p, s));
76} 76}
77 77
78/* Change the size of an allocated block of memory P to an array of N 78/* Change the size of an allocated block of memory P to an array of N
@@ -90,7 +90,7 @@ xreallocarray (void *p, size_t n, size_t s)
90void * 90void *
91xireallocarray (void *p, idx_t n, idx_t s) 91xireallocarray (void *p, idx_t n, idx_t s)
92{ 92{
93 return nonnull (ireallocarray (p, n, s)); 93 return check_nonnull (ireallocarray (p, n, s));
94} 94}
95 95
96/* Allocate an array of N objects, each with S bytes of memory, 96/* Allocate an array of N objects, each with S bytes of memory,
@@ -295,13 +295,13 @@ xizalloc (idx_t s)
295void * 295void *
296xcalloc (size_t n, size_t s) 296xcalloc (size_t n, size_t s)
297{ 297{
298 return nonnull (calloc (n, s)); 298 return check_nonnull (calloc (n, s));
299} 299}
300 300
301void * 301void *
302xicalloc (idx_t n, idx_t s) 302xicalloc (idx_t n, idx_t s)
303{ 303{
304 return nonnull (icalloc (n, s)); 304 return check_nonnull (icalloc (n, s));
305} 305}
306 306
307/* Clone an object P of size S, with error checking. There's no need 307/* Clone an object P of size S, with error checking. There's no need