fix cx_mempool_free crash if ptr is null

Wed, 23 Oct 2024 19:33:36 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 23 Oct 2024 19:33:36 +0200
changeset 947
2a47b4a5c216
parent 946
b428424c0214
child 948
036b431e70ee

fix cx_mempool_free crash if ptr is null

src/mempool.c file | annotate | diff | comparison | revisions
--- a/src/mempool.c	Tue Oct 22 23:10:31 2024 +0200
+++ b/src/mempool.c	Wed Oct 23 19:33:36 2024 +0200
@@ -113,6 +113,7 @@
         void *p,
         void *ptr
 ) {
+    if (!ptr) return;
     struct cx_mempool_s *pool = p;
 
     struct cx_mempool_memory_s *mem = (struct cx_mempool_memory_s *)

mercurial