0
0
mirror of https://github.com/vim/vim.git synced 2025-11-15 23:14:06 -05:00

patch 9.1.1580: possible memory leak in vim9type.c

Problem:  possible memory leak in vim9type.c
Solution: Free tuple_types_ga if there was an error in
          type_type_add_types() (Lidong Yan)

In parse_type_tuple() at src/vim9type.c, we allocate memory
in `tuple_types_ga` by ga_grow(), but forget to free it when
tuple_type_add_types() fails. Replace `return NULL` with `goto on_err`
to fix leak.

closes: #17820

Signed-off-by: Lidong Yan <yldhome2d2@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Lidong Yan
2025-07-22 18:11:11 +02:00
committed by Christian Brabandt
parent 7cf31ce9c4
commit 13e1af7de9
2 changed files with 6 additions and 2 deletions

View File

@@ -719,6 +719,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1580,
/**/
1579,
/**/