Re: [PATCH v3 02/11] reftable: fix resource leak in error path
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Dec 13, 2021, 16:44 UTC
- Message-ID
- <CAFQ2z_MrSEExScfBPku1uTZQgBYyk-B08U98zs5P7LNdLphutg@mail.gmail.com>
- In-Reply-To
- <211213.86pmq08ogt.gmgdl@evledraar.gmail.com>
On Mon, Dec 13, 2021 at 5:21 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> Other things in the codebase don't check for NULL before feeding things > to reftable_free(), and our own free() has a coccicheck rule to catch > this sort of code, we should probably add reftable_free to that list...
Thanks, changed.
> > + struct reftable_block_source source = { NULL };
>
> Nit: It doesn't matter for semantics, but usually we use "{ 0 }", and
> your 1/11 does too. Would be better to do that here for consistency.I got a past review where someone complained about this. I don't mind either way, but would rather not flipflop.
Show 6 quoted lines
>
> > + for (i = 0; i < sizeof(message)-1; i++) {
> > + message[i] = (uint8_t)(rand() % 64 + ' ');
> > + }
>
> style: braces not needede.Done.
-- Han-Wen Nienhuys - Google Munich I work 80%. Don't expect answers from me on Fridays. -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Paul Manicle, Halimah DeLaine Prado