am: don't pass strvec to apply_parse_options()
commita658e881c138c8bc398d1d4b9b6db9e29b16673c
authorRené Scharfe <l.s.r@web.de>
Tue, 13 Dec 2022 06:47:59 +0000 (13 07:47 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Dec 2022 13:07:37 +0000 (13 22:07 +0900)
tree900b01ae8a8271244192eddd5ef3ae542774976a
parent8706a59933d09354c5e3eb09a543453655a97183
am: don't pass strvec to apply_parse_options()

apply_parse_options() passes the array of argument strings to
parse_options(), which removes recognized options.  The removed strings
are not freed, though.

Make a copy of the strvec to pass to the function to retain the pointers
of its strings, so we release them all at the end.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c