Patch 9.0.0624

4 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 29, 2022, 3:24:16 PM9/29/22
to vim...@googlegroups.com

Patch 9.0.0624
Problem: Leaking argument type array.
Solution: Add allocated memory to type_gap.
Files: src/vim9type.c


*** ../vim-9.0.0623/src/vim9type.c 2022-09-29 19:14:37.675876694 +0100
--- src/vim9type.c 2022-09-29 20:20:52.009055427 +0100
***************
*** 58,70 ****
return type;
*copy = *type;

! if (type->tt_args != NULL)
! {
! copy->tt_args = ALLOC_MULT(type_T *, type->tt_argcount);
! if (copy->tt_args != NULL)
! for (int i = 0; i < type->tt_argcount; ++i)
! copy->tt_args[i] = type->tt_args[i];
! }

return copy;
}
--- 58,67 ----
return type;
*copy = *type;

! if (type->tt_args != NULL
! && func_type_add_arg_types(copy, type->tt_argcount, type_gap) == OK)
! for (int i = 0; i < type->tt_argcount; ++i)
! copy->tt_args[i] = type->tt_args[i];

return copy;
}
*** ../vim-9.0.0623/src/version.c 2022-09-29 19:14:37.679876726 +0100
--- src/version.c 2022-09-29 20:21:39.984826388 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 624,
/**/

--
Your fault: core dumped

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages