Skip to content

Commit a065805

Browse files
committed
Fix for simdjson#345
1 parent f41a18b commit a065805

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎include/simdjson/jsonparser.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ int json_parse_implementation(const uint8_t *buf, size_t len, ParsedJson &pj,
3232
} // if(realloc_if_needed) {
3333
int stage1_is_ok = simdjson::find_structural_bits<T>(buf, len, pj);
3434
if (stage1_is_ok != simdjson::SUCCESS) {
35+
if (reallocated) { // must free before we exit
36+
aligned_free((void *)buf);
37+
}
3538
pj.error_code = stage1_is_ok;
3639
return pj.error_code;
3740
}

0 commit comments

Comments
 (0)