Mercurial > vim
comparison src/vim9execute.c @ 22952:629472e2e4c5 v8.2.2023
patch 8.2.2023: Vim: memory leak when :execute fails
Commit: https://github.com/vim/vim/commit/c71ee829efa948eefec3b8f0dbacf172fc1a4992
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 21 11:45:50 2020 +0100
patch 8.2.2023: Vim: memory leak when :execute fails
Problem: Vim: memory leak when :execute fails.
Solution: Clear the growarray.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 21 Nov 2020 12:00:04 +0100 |
parents | 707b90980de5 |
children | 4c97c0747017 |
comparison
equal
deleted
inserted
replaced
22951:e857d80bab79 | 22952:629472e2e4c5 |
---|---|
1198 } | 1198 } |
1199 clear_tv(tv); | 1199 clear_tv(tv); |
1200 } | 1200 } |
1201 ectx.ec_stack.ga_len -= count; | 1201 ectx.ec_stack.ga_len -= count; |
1202 if (failed) | 1202 if (failed) |
1203 { | |
1204 ga_clear(&ga); | |
1203 goto on_error; | 1205 goto on_error; |
1206 } | |
1204 | 1207 |
1205 if (ga.ga_data != NULL) | 1208 if (ga.ga_data != NULL) |
1206 { | 1209 { |
1207 if (iptr->isn_type == ISN_EXECUTE) | 1210 if (iptr->isn_type == ISN_EXECUTE) |
1208 { | 1211 { |
1209 SOURCING_LNUM = iptr->isn_lnum; | 1212 SOURCING_LNUM = iptr->isn_lnum; |
1210 do_cmdline_cmd((char_u *)ga.ga_data); | 1213 do_cmdline_cmd((char_u *)ga.ga_data); |
1211 if (did_emsg) | 1214 if (did_emsg) |
1215 { | |
1216 ga_clear(&ga); | |
1212 goto on_error; | 1217 goto on_error; |
1218 } | |
1213 } | 1219 } |
1214 else | 1220 else |
1215 { | 1221 { |
1216 msg_sb_eol(); | 1222 msg_sb_eol(); |
1217 if (iptr->isn_type == ISN_ECHOMSG) | 1223 if (iptr->isn_type == ISN_ECHOMSG) |