summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pugixpath.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp
index 051d3b6..e7975ec 100644
--- a/src/pugixpath.cpp
+++ b/src/pugixpath.cpp
@@ -561,6 +561,9 @@ namespace pugi
void* alloc(size_t size)
{
+ // align size so that we're able to store pointers in subsequent blocks
+ size = (size + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
+
if (m_root->size + size <= xpath_memory_block_size)
{
void* buf = m_root->data + m_root->size;