Message ID | 700387ac5d386aec5c1525223bd5952b037b15cf.1639000187.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Reftable coverity fixes | expand |
diff --git a/reftable/reader.c b/reftable/reader.c index 006709a645a..8d308d858f8 100644 --- a/reftable/reader.c +++ b/reftable/reader.c @@ -796,6 +796,7 @@ int reftable_reader_print_file(const char *tablename) reftable_table_from_reader(&tab, r); err = reftable_table_print(&tab); done: - reftable_reader_free(r); + if (r) + reftable_reader_free(r); return err; } diff --git a/reftable/stack.c b/reftable/stack.c index 10dfd370e8e..eb03b6c74f6 100644 --- a/reftable/stack.c +++ b/reftable/stack.c @@ -707,7 +707,8 @@ done: strbuf_release(&temp_tab_file_name); strbuf_release(&tab_file_name); strbuf_release(&next_name); - reftable_writer_free(wr); + if (wr) + reftable_writer_free(wr); return err; }