patch 8.2.1860: Vim9: memory leak when throwing empty string
Problem: Vim9: memory leak when throwing empty string. Solution: Free the empty string.
This commit is contained in:
		| @ -750,6 +750,8 @@ static char *(features[]) = | |||||||
|  |  | ||||||
| static int included_patches[] = | static int included_patches[] = | ||||||
| {   /* Add new patch number below this line */ | {   /* Add new patch number below this line */ | ||||||
|  | /**/ | ||||||
|  |     1860, | ||||||
| /**/ | /**/ | ||||||
|     1859, |     1859, | ||||||
| /**/ | /**/ | ||||||
|  | |||||||
| @ -2094,6 +2094,7 @@ call_def_function( | |||||||
| 		if (tv->vval.v_string == NULL | 		if (tv->vval.v_string == NULL | ||||||
| 				       || *skipwhite(tv->vval.v_string) == NUL) | 				       || *skipwhite(tv->vval.v_string) == NUL) | ||||||
| 		{ | 		{ | ||||||
|  | 		    vim_free(tv->vval.v_string); | ||||||
| 		    emsg(_(e_throw_with_empty_string)); | 		    emsg(_(e_throw_with_empty_string)); | ||||||
| 		    goto failed; | 		    goto failed; | ||||||
| 		} | 		} | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user