diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2022-05-19 17:27:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-19 17:27:05 +0300 |
commit | 11f6eba6f752ec1198640407503173f9c47858ee (patch) | |
tree | 05519c01d76d94a5f08b9f1148a226318f6ebbf7 /libnetdata | |
parent | 947c9351ed105bd0dd93c06c6d78eb2825ddc7a0 (diff) |
Suppress warning when freeing a NULL pointer in onewayalloc_freez (#12955)
Diffstat (limited to 'libnetdata')
-rw-r--r-- | libnetdata/onewayalloc/onewayalloc.c | 3 |
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; |