]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/fetch-pack: cleanup before return error
authorLidong Yan <502024330056@smail.nju.edu.cn>
Wed, 4 Jun 2025 03:07:54 +0000 (03:07 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Jun 2025 15:52:25 +0000 (08:52 -0700)
commitaedebdb6b99af5fb5a61ae1359c1ed3a7b55135c
tree85149a479e5b768cef320ac753f59c193db523e7
parentd50a5e8939abfc07c2ff97ae72e9330939b36ee0
builtin/fetch-pack: cleanup before return error

In builtin/fetch-pack.c:cmd_fetch_pack(), if finish_connect() failed,
it returns error code without cleanup which cause memory leak. Add
cleanup label before frees in the end of cmd_fetch_pack(), and add
`goto cleanup` if finish_connect() failed.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch-pack.c