From d20c5855b16b65ecc55c83f02b60043992da39e7 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 29 Jan 2015 13:06:12 +0100 Subject: [PATCH] added derived file --- lib/JsonParser/json-parser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/JsonParser/json-parser.cpp b/lib/JsonParser/json-parser.cpp index 0a02cbf3ea..d4ed8cb215 100644 --- a/lib/JsonParser/json-parser.cpp +++ b/lib/JsonParser/json-parser.cpp @@ -2146,10 +2146,12 @@ static bool ParseArray (yyscan_t scanner, TRI_json_t* result) { yyextra._message = "out-of-memory"; return false; } + + // be paranoid and initialize the memory + TRI_InitNullJson(next); if (! ParseValue(scanner, next, c)) { // be paranoid - TRI_InitNullJson(next); return false; } @@ -2256,10 +2258,12 @@ static bool ParseObject (yyscan_t scanner, TRI_json_t* result) { next = static_cast(TRI_NextVector(&result->_value._objects)); // we made sure with the reserve call that we haven't run out of memory TRI_ASSERT_EXPENSIVE(next != nullptr); + + // be paranoid and initialize the memory + TRI_InitNullJson(next); if (! ParseValue(scanner, next, c)) { // be paranoid - TRI_InitNullJson(next); return false; } }