Fix memory allocation of the max_depth in JsonStream.

This commit is contained in:
Jeremie Piotte 2019-11-28 13:55:31 -05:00 committed by GitHub
parent e63f258470
commit 4e1c90f76f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -30,8 +30,8 @@ void JsonStream::set_new_buffer(const char *buf, size_t len) {
int JsonStream::json_parse(ParsedJson &pj) {
if (pj.byte_capacity == 0) {
const bool allocok = pj.allocate_capacity(_batch_size, _batch_size);
const bool allocok_thread = pj_thread.allocate_capacity(_batch_size, _batch_size);
const bool allocok = pj.allocate_capacity(_batch_size);
const bool allocok_thread = pj_thread.allocate_capacity(_batch_size);
if (!allocok || !allocok_thread) {
std::cerr << "can't allocate memory" << std::endl;
return false;