Mercurial > vim
comparison src/vim9compile.c @ 25816:d9a0847550c6 v8.2.3443
patch 8.2.3443: Vim9: memory leak when and/or fails
Commit: https://github.com/vim/vim/commit/3dfe2e0fb8768914a019fa04b1ed9581e33c9b26
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 16 20:14:51 2021 +0200
patch 8.2.3443: Vim9: memory leak when and/or fails
Problem: Vim9: memory leak when and/or fails.
Solution: Also clear the growarray when the length is zero.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 16 Sep 2021 20:15:04 +0200 |
parents | dd4e86558836 |
children | 377a7686a52f |
comparison
equal
deleted
inserted
replaced
25815:e41747c63ed5 | 25816:d9a0847550c6 |
---|---|
5266 | 5266 |
5267 if (!IS_WHITE_OR_NUL(**arg) || !IS_WHITE_OR_NUL(p[2])) | 5267 if (!IS_WHITE_OR_NUL(**arg) || !IS_WHITE_OR_NUL(p[2])) |
5268 { | 5268 { |
5269 semsg(_(e_white_space_required_before_and_after_str_at_str), | 5269 semsg(_(e_white_space_required_before_and_after_str_at_str), |
5270 op, p); | 5270 op, p); |
5271 ga_clear(&end_ga); | |
5271 return FAIL; | 5272 return FAIL; |
5272 } | 5273 } |
5273 | 5274 |
5274 save_sourcing_lnum = SOURCING_LNUM; | 5275 save_sourcing_lnum = SOURCING_LNUM; |
5275 SOURCING_LNUM = start_lnum; | 5276 SOURCING_LNUM = start_lnum; |
5386 --end_ga.ga_len; | 5387 --end_ga.ga_len; |
5387 isn = ((isn_T *)instr->ga_data) | 5388 isn = ((isn_T *)instr->ga_data) |
5388 + *(((int *)end_ga.ga_data) + end_ga.ga_len); | 5389 + *(((int *)end_ga.ga_data) + end_ga.ga_len); |
5389 isn->isn_arg.jump.jump_where = instr->ga_len; | 5390 isn->isn_arg.jump.jump_where = instr->ga_len; |
5390 } | 5391 } |
5391 ga_clear(&end_ga); | 5392 } |
5392 } | 5393 ga_clear(&end_ga); |
5393 | 5394 |
5394 cctx->ctx_skip = save_skip; | 5395 cctx->ctx_skip = save_skip; |
5395 } | 5396 } |
5396 | 5397 |
5397 return OK; | 5398 return OK; |