]> git.ipfire.org Git - thirdparty/git.git/commit
mailinfo.c: fix memory leak in function handle_content_type()
authorJinyao Guo <guo846@purdue.edu>
Fri, 13 Jun 2025 19:26:45 +0000 (19:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 14 Jun 2025 16:42:14 +0000 (09:42 -0700)
commitff73f375bbff4b35ef97fb6890de9deaa90924f0
tree14cf0b968ad4f2f82504220ac25267ad45e475b6
parentd50a5e8939abfc07c2ff97ae72e9330939b36ee0
mailinfo.c: fix memory leak in function handle_content_type()

The function handle_content_type allocates memory for boundary
using xmalloc(sizeof(struct strbuf)). If (++mi->content_top >=
&mi->content[MAX_BOUNDARIES]) is true, the function returns
without freeing boundary.

Signed-off-by: Jinyao Guo <guo846@purdue.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mailinfo.c