This commit is contained in:
Daniel Lemire 2019-10-24 15:34:30 -04:00
parent f41a18b57d
commit a065805b0f
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,9 @@ int json_parse_implementation(const uint8_t *buf, size_t len, ParsedJson &pj,
} // if(realloc_if_needed) {
int stage1_is_ok = simdjson::find_structural_bits<T>(buf, len, pj);
if (stage1_is_ok != simdjson::SUCCESS) {
if (reallocated) { // must free before we exit
aligned_free((void *)buf);
}
pj.error_code = stage1_is_ok;
return pj.error_code;
}