Problem: Memory leak in compile_expr6() on alloc failure
Solution: Free left string when constant string concat alloc fails
(Yasuhiro Matsumoto).
compile_expr6() overwrote tv1's string pointer before allocating the
concatenation buffer, leaking the original left-hand string on failure.
related: #20668
related: #20745
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 798,
/**/
797,
/**/
tv1->vval.v_string = alloc(len1 + STRLEN(s2) + 1);
if (tv1->vval.v_string == NULL)
{
+ vim_free(s1);
clear_ppconst(ppconst);
return FAIL;
}