# HG changeset patch # User Mike Becker # Date 1765032953 -3600 # Node ID 7822ffe658488df98b9f5fc2349d313757e8166f # Parent 8fc6f4cdc5b08de3985e9753c303864a72fa0605 fixes critical memory leak when using cxMapFree() on a kv-list that is using destructors diff -r 8fc6f4cdc5b0 -r 7822ffe65848 CHANGELOG --- a/CHANGELOG Sat Dec 06 15:50:55 2025 +0100 +++ b/CHANGELOG Sat Dec 06 15:55:53 2025 +0100 @@ -4,7 +4,8 @@ * adds cx_system_page_size() to allocator.h * changes cxBufferReserve() to allow reducing the capacity * changes the members of CxJson and CxJsonValue - * fix that cxReallocate(), cxReallocateArray(), cx_reallocate(), and cx_reallocatearray() + * fixes critical memory leak when using cxMapFree() on a kv-list that is using destructors + * fixes that cxReallocate(), cxReallocateArray(), cx_reallocate(), and cx_reallocatearray() were not returning zero after freeing the memory when passed a size of zero Version 3.2 - 2025-11-30 diff -r 8fc6f4cdc5b0 -r 7822ffe65848 docs/Writerside/topics/about.md --- a/docs/Writerside/topics/about.md Sat Dec 06 15:50:55 2025 +0100 +++ b/docs/Writerside/topics/about.md Sat Dec 06 15:55:53 2025 +0100 @@ -31,7 +31,8 @@ * adds cx_system_page_size() to allocator.h * changes cxBufferReserve() to allow reducing the capacity * changes the members of CxJson and CxJsonValue -* fix that cxReallocate(), cxReallocateArray(), cx_reallocate(), and cx_reallocatearray() +* fixes critical memory leak when using cxMapFree() on a kv-list that is using destructors +* fixes that cxReallocate(), cxReallocateArray(), cx_reallocate(), and cx_reallocatearray() were not returning zero after freeing the memory when passed a size of zero ### Version 3.2 - 2025-11-30 {collapsible="true"} diff -r 8fc6f4cdc5b0 -r 7822ffe65848 src/kv_list.c --- a/src/kv_list.c Sat Dec 06 15:50:55 2025 +0100 +++ b/src/kv_list.c Sat Dec 06 15:55:53 2025 +0100 @@ -285,6 +285,7 @@ static void cx_kvl_map_deallocate(struct cx_map_s *map) { cx_kv_list *kv_list = ((struct cx_kv_list_map_s*)map)->list; + cx_kv_list_update_destructors(kv_list); kv_list->map_methods->deallocate(map); kv_list->list_methods->deallocate(&kv_list->list.base); }