comparison src/vim9compile.c @ 20001:502a6c9b3974 v8.2.0556

patch 8.2.0556: Vim9: memory leak when finding common type Commit: https://github.com/vim/vim/commit/c5f1ef53c24cc0c9f7b2131609e916f913634feb Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 12 17:11:27 2020 +0200 patch 8.2.0556: Vim9: memory leak when finding common type Problem: Vim9: memory leak when finding common type. Solution: Store allocated memory in type growarray.
author Bram Moolenaar <Bram@vim.org>
date Sun, 12 Apr 2020 17:15:03 +0200
parents 844c7646f61b
children 49d692e015cc
comparison
equal deleted inserted replaced
20000:87ecc4245e93 20001:502a6c9b3974
1821 int i; 1821 int i;
1822 1822
1823 *dest = alloc_func_type(common, argcount, type_gap); 1823 *dest = alloc_func_type(common, argcount, type_gap);
1824 if (type1->tt_args != NULL && type2->tt_args != NULL) 1824 if (type1->tt_args != NULL && type2->tt_args != NULL)
1825 { 1825 {
1826 (*dest)->tt_args = ALLOC_CLEAR_MULT(type_T *, argcount); 1826 if (func_type_add_arg_types(*dest, argcount,
1827 if ((*dest)->tt_args != NULL) 1827 type_gap) == OK)
1828 for (i = 0; i < argcount; ++i) 1828 for (i = 0; i < argcount; ++i)
1829 common_type(type1->tt_args[i], type2->tt_args[i], 1829 common_type(type1->tt_args[i], type2->tt_args[i],
1830 &(*dest)->tt_args[i], type_gap); 1830 &(*dest)->tt_args[i], type_gap);
1831 } 1831 }
1832 } 1832 }