]> git.ipfire.org Git - thirdparty/git.git/commit
parse-options: fix leaks for users of OPT_FILENAME
authorPatrick Steinhardt <ps@pks.im>
Tue, 11 Jun 2024 09:19:22 +0000 (11:19 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2024 20:15:04 +0000 (13:15 -0700)
commit14da26230a7644a2f9dfbc3f43d9d7ab6e0074e9
tree600341b6864236888a6508a79bf46e97436ded8b
parent56931c4d89e7efe41dd96d230b8176e2d32a035d
parse-options: fix leaks for users of OPT_FILENAME

The `OPT_FILENAME()` option will, if set, put an allocated string into
the user-provided variable. Consequently, that variable thus needs to be
free'd by the caller of `parse_options()`. Some callsites don't though
and thus leak memory. Fix those.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 files changed:
apply.c
apply.h
builtin/archive.c
builtin/commit.c
builtin/fmt-merge-msg.c
builtin/log.c
builtin/multi-pack-index.c
builtin/sparse-checkout.c
t/helper/test-parse-options.c
t/t1512-rev-parse-disambiguation.sh
t/t2500-untracked-overwriting.sh
t/t3406-rebase-message.sh
t/t3407-rebase-abort.sh
t/t3428-rebase-signoff.sh
t/t4131-apply-fake-ancestor.sh
t/t4151-am-abort.sh
t/t4253-am-keep-cr-dos.sh
t/t4255-am-submodule.sh
t/t5407-post-rewrite-hook.sh
t/t6427-diff3-conflict-markers.sh
t/t7512-status-help.sh