From 872d651f528443efa5586a2d81a7629448545f61 Mon Sep 17 00:00:00 2001 From: Rene Scharfe Date: Wed, 30 Aug 2017 20:00:28 +0200 Subject: [PATCH] send-pack: release strbuf on error return in send_pack() Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- send-pack.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/send-pack.c b/send-pack.c index 11d6f3d983..b865f662e4 100644 --- a/send-pack.c +++ b/send-pack.c @@ -492,8 +492,11 @@ int send_pack(struct send_pack_args *args, * we were to send it and we're trying to send the refs * atomically, abort the whole operation. */ - if (use_atomic) + if (use_atomic) { + strbuf_release(&req_buf); + strbuf_release(&cap_buf); return atomic_push_failure(args, remote_refs, ref); + } /* Fallthrough for non atomic case. */ default: continue;