]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - compat/xalloc.cc
Source Format Enforcement (#1234)
[thirdparty/squid.git] / compat / xalloc.cc
index b2f087cd613893d1cb24ed6d5685ea17aa0fd50b..812c5e3193995706c4624bc29d2f82a964402e49 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -78,7 +78,7 @@ xcalloc(size_t n, size_t sz)
 
     void *p = calloc(n, sz);
 
-    if (p == NULL) {
+    if (!p) {
         if (failure_notify) {
             static char msg[128];
             snprintf(msg, 128, "xcalloc: Unable to allocate %" PRIuSIZE " blocks of %" PRIuSIZE " bytes!\n", n, sz);
@@ -104,7 +104,7 @@ xmalloc(size_t sz)
 
     void *p = malloc(sz);
 
-    if (p == NULL) {
+    if (!p) {
         if (failure_notify) {
             static char msg[128];
             snprintf(msg, 128, "xmalloc: Unable to allocate %" PRIuSIZE " bytes!\n", sz);
@@ -130,7 +130,7 @@ xrealloc(void *s, size_t sz)
 
     void *p= realloc(s, sz);
 
-    if (p == NULL) {
+    if (!p) {
         if (failure_notify) {
             static char msg[128];
             snprintf(msg, 128, "xrealloc: Unable to reallocate %" PRIuSIZE " bytes!\n", sz);