]> git.ipfire.org Git - thirdparty/git.git/commit - add-patch.c
add -p: fix memory leak
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Mon, 7 Sep 2020 15:04:00 +0000 (15:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
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 <phillip.wood@dunelm.org.uk>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-patch.c