add -p: fix memory leak
authorPhillip Wood <redacted>
Mon, 7 Sep 2020 15:04:00 +0000 (15:04 +0000)
committerJunio C Hamano <redacted>
Tue, 8 Sep 2020 21:51:38 +0000 (14:51 -0700)
commit324efcf6b6d30d43b98e76c7beac90ecfb40d637
treee060ddbd6c8e39b9c067971af70c08c74b18fda5
parent47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc
add -p: fix memory leak

asan reports that the C version of `add -p` is not freeing all the
memory it allocates. Fix this by introducing a function to clear
`struct add_p_state` and use it instead of freeing individual members.

Signed-off-by: Phillip Wood <redacted>
Acked-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
add-patch.c
git clone https://git.99rst.org/PROJECT