Re: [PATCH v2 11/20] builtin/commit-graph.c: let parse-options parse subcommands
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Aug 19, 2022, 18:22 UTC
- Message-ID
- <20220819182204.GA3373722@szeder.dev>
- In-Reply-To
- <220819.8635ds6run.gmgdl@evledraar.gmail.com>
On Fri, Aug 19, 2022 at 07:53:08PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 5 quoted lines
> > + argc = parse_options(argc, argv, prefix, options, > > + builtin_commit_graph_usage, 0); > > + FREE_AND_NULL(options); > > Why FREE_AND_NULL() over free()?
Heh, it's interesting that you should ask that ;)
I followed the existing pattern for now, just like you did in 84e4484f12 (commit-graph: use parse_options_concat(), 2021-08-23), where you made graph_verify() and graph_write() use FREE_AND_NULL() to release their concatenated options arrays.
But yeah, a plain free() should work just fine in these cases.