commit d8cbc463e9dcdeb0d1ae12ab9f2d1de58f141b14 from: Stefan Sperling date: Sat Dec 28 13:34:56 2024 UTC plug imsgbuf-related memory leak in got_send_pack() commit - 7a9b1c13f55a6aa3392ccc4a59ba7dc278c2683a commit + d8cbc463e9dcdeb0d1ae12ab9f2d1de58f141b14 blob - 22ef7b9115f249c75e351c48ef60688e463dfa39 blob + 87e3a2db6550d35ff268f3ad2af0d88e2f27904a --- lib/send.c +++ lib/send.c @@ -364,6 +364,8 @@ got_send_pack(const char *remote_name, struct got_path RB_INIT(&have_refs); RB_INIT(&their_refs); + + memset(&sendibuf, 0, sizeof(sendibuf)); if (got_repo_get_object_format(repo) != GOT_HASH_SHA1) return got_error_fmt(GOT_ERR_NOT_IMPL, @@ -700,6 +702,8 @@ got_send_pack(const char *remote_name, struct got_path free(errmsg); } done: + if (sendibuf.w) + imsgbuf_clear(&sendibuf); if (sendpid != -1) { if (err) got_privsep_send_stop(imsg_sendfds[0]);