]> git.ipfire.org Git - thirdparty/git.git/commit
imap-send: avoid leaking the IMAP upload buffer
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 5 Jul 2026 08:24:26 +0000 (08:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 5 Jul 2026 16:12:10 +0000 (09:12 -0700)
commit22f92aa62a70e740acfbb4e4c2bfa70d31c50f83
treefaf2ecdf73d02836849299834156bdc624703872
parentda2211be7461762a47b67449cc3a518b8942ec84
imap-send: avoid leaking the IMAP upload buffer

When uploading messages via libcurl, `curl_append_msgs_to_imap()`
accumulates each one in a strbuf that grows across loop iterations but
is never released before the function returns.

Release it alongside the existing libcurl cleanup.

Reported by Coverity as CID 1671507 ("Resource leak").

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c