[PATCH v2 05/12] send-pack: plug leak upon match_push_refs failure
Otherwise memory leak tests will flag the missing finish_connect().
Signed-off-by: Jon Simons <jon@jonsimons.org>
---
builtin/send-pack.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index d6cdbae472..4e6a45ba30 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -311,6 +311,9 @@ int cmd_send_pack(int argc,
/* match them up */
if (match_push_refs(local_refs, &remote_refs, &rs, flags)) {
ret = -1;
+ close(fd[1]);
+ close(fd[0]);
+ finish_connect(conn);
goto cleanup;
}
if (!is_empty_cas(&cas))
--
2.55.0