send-pack: release strbuf on error return in send_pack()

Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Rene Scharfe committed Aug 30, 2017 at 20:00 UTC 872d651f528443efa5586a2d81a7629448545f61
1 file changed +4 -1
send-pack.c
+4 -1
@@ -492,8 +492,11 @@ int send_pack(struct send_pack_args *args,
492 * we were to send it and we're trying to send the refs
493 * atomically, abort the whole operation.
494 */
495 - if (use_atomic)
495 + if (use_atomic) {
496 + strbuf_release(&req_buf);
497 + strbuf_release(&cap_buf);
498 return atomic_push_failure(args, remote_refs, ref);
499 + }
500 /* Fallthrough for non atomic case. */
501 default:
502 continue;