Skip to content

Commit 872d651

Browse files
rscharfegitster
authored andcommitted
send-pack: release strbuf on error return in send_pack()
Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 85af9f7 commit 872d651

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

send-pack.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,11 @@ int send_pack(struct send_pack_args *args,
492492
* we were to send it and we're trying to send the refs
493493
* atomically, abort the whole operation.
494494
*/
495-
if (use_atomic)
495+
if (use_atomic) {
496+
strbuf_release(&req_buf);
497+
strbuf_release(&cap_buf);
496498
return atomic_push_failure(args, remote_refs, ref);
499+
}
497500
/* Fallthrough for non atomic case. */
498501
default:
499502
continue;

0 commit comments

Comments
 (0)