fix function was exited without releasing (#1389)

* Update jsoncheck.cpp

* Update minefieldcheck.cpp

* Update jsoncheck.cpp

* Update minefieldcheck.cpp
This commit is contained in:
ihsinme 2021-01-13 02:08:27 +03:00 committed by GitHub
parent 3b8486665a
commit 84b0e84447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -65,6 +65,8 @@ bool validate(const char *dirname) {
auto error = simdjson::padded_string::load(fullpath).get(p);
if (error) {
std::cerr << "Could not load the file " << fullpath << std::endl;
free(fullpath);
delete[] is_file_as_expected;
return EXIT_FAILURE;
}
simdjson::dom::parser parser;

View File

@ -63,6 +63,8 @@ bool validate_minefield(const char *dirname) {
auto error = simdjson::padded_string::load(fullpath).get(p);
if (error) {
std::cerr << "Could not load the file " << fullpath << std::endl;
free(fullpath);
delete[] is_file_as_expected;
return EXIT_FAILURE;
}
simdjson::dom::parser parser;