@cryptotaxi247 / netdata-1 / commits / 11f6eba6f

Suppress warning when freeing a NULL pointer in onewayalloc_freez (#12955)

Stelios Fragkakis committed May 19, 2022 at 17:27 UTC 11f6eba6f752ec1198640407503173f9c47858ee
1 file changed +3
libnetdata/onewayalloc/onewayalloc.c
+3
@@ -133,6 +133,9 @@ void onewayalloc_freez(ONEWAYALLOC *owa __maybe_unused, const void *ptr __maybe_
133 // so try to find it in our memory and if it is not there
134 // log an error
135
136 + if (unlikely(!ptr))
137 + return;
138 +
139 OWA_PAGE *head = (OWA_PAGE *)owa;
140 OWA_PAGE *page;
141 size_t seeking = (size_t)ptr;