comparison src/eval.c @ 24240:2194227d034a v8.2.2661

patch 8.2.2661: leaking memory when looping over a string Commit: https://github.com/vim/vim/commit/bb5d87c8504588be9c9d2fecc5b6455a2b2f6201 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 26 22:15:26 2021 +0100 patch 8.2.2661: leaking memory when looping over a string Problem: Leaking memory when looping over a string. Solution: Free the memory.
author Bram Moolenaar <Bram@vim.org>
date Fri, 26 Mar 2021 22:30:02 +0100
parents 7ffc795288dd
children 01b274c3f69b
comparison
equal deleted inserted replaced
24239:4abfff4a120d 24240:2194227d034a
1813 return FALSE; 1813 return FALSE;
1814 tv.v_type = VAR_STRING; 1814 tv.v_type = VAR_STRING;
1815 tv.v_lock = VAR_FIXED; 1815 tv.v_lock = VAR_FIXED;
1816 tv.vval.v_string = vim_strnsave(fi->fi_string + fi->fi_byte_idx, len); 1816 tv.vval.v_string = vim_strnsave(fi->fi_string + fi->fi_byte_idx, len);
1817 fi->fi_byte_idx += len; 1817 fi->fi_byte_idx += len;
1818 return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon, 1818 result = ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
1819 fi->fi_varcount, flag, NULL) == OK; 1819 fi->fi_varcount, flag, NULL) == OK;
1820 vim_free(tv.vval.v_string);
1821 return result;
1820 } 1822 }
1821 1823
1822 item = fi->fi_lw.lw_item; 1824 item = fi->fi_lw.lw_item;
1823 if (item == NULL) 1825 if (item == NULL)
1824 result = FALSE; 1826 result = FALSE;