1
0
Fork 0

initialize memory

This commit is contained in:
Jan Steemann 2015-01-29 11:43:25 +01:00
parent 39d72b1530
commit 85bf84e1bb
1 changed files with 6 additions and 2 deletions

View File

@ -229,10 +229,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;
}
@ -339,10 +341,12 @@ static bool ParseObject (yyscan_t scanner, TRI_json_t* result) {
next = static_cast<TRI_json_t*>(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;
}
}