Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'include/rapidjson/allocators.h')
-rw-r--r--include/rapidjson/allocators.h3
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;