]> git.kaiwu.me - njs.git/commitdiff
Improved njs_mp_free() to aling with free() semantics.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 8 Sep 2022 17:03:25 +0000 (10:03 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 8 Sep 2022 17:03:25 +0000 (10:03 -0700)
Previously, njs_mp_free() issued an assertion when p == NULL, while NULL
argument is explicitly allowed for free().

src/njs_mp.c

index 27b246333825712d6f8ec007657c081ede65e612..86b44d96c68de6acc560a101e45ef31cbe30cfea 100644 (file)
@@ -682,7 +682,7 @@ njs_mp_free(njs_mp_t *mp, void *p)
         }
 
     } else {
-        njs_assert_msg(0, "freed pointer is out of mp: %p\n", p);
+        njs_assert_msg(p == NULL, "freed pointer is out of mp: %p\n", p);
     }
 }