From f361a435ade5c09e4751986e72df399f5547d6e2 Mon Sep 17 00:00:00 2001 From: Daniel Parker Date: Wed, 11 Oct 2023 17:14:27 -0400 Subject: [PATCH] Fix alignment issue with heap_string --- include/jsoncons/detail/heap_string.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/jsoncons/detail/heap_string.hpp b/include/jsoncons/detail/heap_string.hpp index 265ae7d29e..d4165cbab5 100644 --- a/include/jsoncons/detail/heap_string.hpp +++ b/include/jsoncons/detail/heap_string.hpp @@ -172,7 +172,7 @@ namespace detail { std::size_t mem_size = aligned_size(ptr->length_*sizeof(char_type)); byte_allocator_type byte_alloc(ptr->get_allocator()); - byte_alloc.deallocate(p,mem_size); + byte_alloc.deallocate(p,mem_size + ptr->offset_); } } };