]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/multi-pack-index.c: don't leak concatenated options
authorTaylor Blau <me@ttaylorr.com>
Tue, 26 Oct 2021 21:01:18 +0000 (17:01 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Oct 2021 22:32:14 +0000 (15:32 -0700)
commitee4a1d63d7e9bdbea6bbeeb3f82ef33030de9ffb
treeab2b265884ef943252bfb154218089c4c58addb0
parente6432e0f1f183595b265b76ca765c612e705c65a
builtin/multi-pack-index.c: don't leak concatenated options

The `multi-pack-index` builtin dynamically allocates an array of
command-line option for each of its separate modes by calling
add_common_options() to concatante the common options with sub-command
specific ones.

Because this operation allocates a new array, we have to be careful to
remember to free it. We already do this in the repack and write
sub-commands, but verify and expire don't. Rectify this by calling
FREE_AND_NULL as the other modes do.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/multi-pack-index.c