commit 176a525f12805253c6786c12f171feaa38da2902420b646298d5b97d622b2817 from: Stefan Sperling date: Sat Dec 28 13:34:56 2024 UTC plug imsgbuf-related memory leak in got_send_pack() commit - e06f726988f1ba79878783300e73db2564643823dd9d0ced9f28f098a1175e2d commit + 176a525f12805253c6786c12f171feaa38da2902420b646298d5b97d622b2817 blob - 9f5e27a74a5df765e57e2d7652d5d112a0ef6af4e74c4516292acf7ea4a0f38d blob + b50257b916a24468036d91c0b3384cb67556b5a12bead04689ec87bd646477b6 --- lib/send.c +++ lib/send.c @@ -365,6 +365,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, "sha256 object IDs unsupported in network protocol"); @@ -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]);