summaryrefslogtreecommitdiffstats
path: root/libnetdata
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2022-05-19 17:27:05 +0300
committerGitHub <noreply@github.com>2022-05-19 17:27:05 +0300
commit11f6eba6f752ec1198640407503173f9c47858ee (patch)
tree05519c01d76d94a5f08b9f1148a226318f6ebbf7 /libnetdata
parent947c9351ed105bd0dd93c06c6d78eb2825ddc7a0 (diff)
Suppress warning when freeing a NULL pointer in onewayalloc_freez (#12955)
Diffstat (limited to 'libnetdata')
-rw-r--r--libnetdata/onewayalloc/onewayalloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libnetdata/onewayalloc/onewayalloc.c b/libnetdata/onewayalloc/onewayalloc.c
index 8c9ec76d26..a048aebf6b 100644
--- a/libnetdata/onewayalloc/onewayalloc.c
+++ b/libnetdata/onewayalloc/onewayalloc.c
@@ -133,6 +133,9 @@ void onewayalloc_freez(ONEWAYALLOC *owa __maybe_unused, const void *ptr __maybe_
// so try to find it in our memory and if it is not there
// log an error
+ if (unlikely(!ptr))
+ return;
+
OWA_PAGE *head = (OWA_PAGE *)owa;
OWA_PAGE *page;
size_t seeking = (size_t)ptr;