Message ID | 47ba5ddceb8cc864cdc3006f7718e00f6ea2c7fc.1639482477.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 33e922432016f614327bcf5624c084b7c02fe9c3 |
Headers | show |
Series | Reftable coverity fixes | expand |
diff --git a/reftable/reader.c b/reftable/reader.c index 006709a645a..733509606a9 100644 --- a/reftable/reader.c +++ b/reftable/reader.c @@ -641,6 +641,8 @@ int reftable_new_reader(struct reftable_reader **p, void reftable_reader_free(struct reftable_reader *r) { + if (!r) + return; reader_close(r); reftable_free(r); } diff --git a/reftable/writer.c b/reftable/writer.c index 3ca721e9f64..9fd24fa93ce 100644 --- a/reftable/writer.c +++ b/reftable/writer.c @@ -150,6 +150,8 @@ void reftable_writer_set_limits(struct reftable_writer *w, uint64_t min, void reftable_writer_free(struct reftable_writer *w) { + if (!w) + return; reftable_free(w->block); reftable_free(w); }