Skip to content

Commit

Permalink
Fix NULL dereferences from previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nirosys committed Jul 14, 2022
1 parent 48883ee commit 400be4f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/cli/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,11 @@ iERR ion_cli_command_compare_standard(IonCliCommonArgs *common_args, ION_EVENT_C
}
if (reader_contexts) {
for (size_t i = 0; i < num_inputs; i++) {
ion_reader_close(reader_contexts[i]->reader);
ion_stream_close(reader_contexts[i]->ion_stream);
delete reader_contexts[i];
if (reader_contexts[i] != NULL) {
ion_reader_close(reader_contexts[i]->reader);
ion_stream_close(reader_contexts[i]->ion_stream);
delete reader_contexts[i];
}
}
free(reader_contexts);
}
Expand Down

0 comments on commit 400be4f

Please sign in to comment.