diff options
Diffstat (limited to 'include/rapidjson/allocators.h')
-rw-r--r-- | include/rapidjson/allocators.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/rapidjson/allocators.h b/include/rapidjson/allocators.h index 16bf0388..b7042a53 100644 --- a/include/rapidjson/allocators.h +++ b/include/rapidjson/allocators.h @@ -189,6 +189,9 @@ public: if (originalPtr == 0)
return Malloc(newSize);
+ if (newSize == 0)
+ return NULL;
+
// Do not shrink if new size is smaller than original
if (originalSize >= newSize)
return originalPtr;
|