Mercurial > vim
comparison src/vim9compile.c @ 23473:ad83c0ff34c0 v8.2.2279
patch 8.2.2279: Vim9: memory leak with catch in skipped block
Commit: https://github.com/vim/vim/commit/508b5618ec0bc6d1edff71e04d99280a2a51df9d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 2 18:17:26 2021 +0100
patch 8.2.2279: Vim9: memory leak with catch in skipped block
Problem: Vim9: memory leak with catch in skipped block.
Solution: Free the pattern if not used.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 02 Jan 2021 18:30:03 +0100 |
parents | d2b1269c2c68 |
children | 95db03521b01 |
comparison
equal
deleted
inserted
replaced
23472:55cfcf83ae29 | 23473:ad83c0ff34c0 |
---|---|
1007 static int | 1007 static int |
1008 generate_PUSHS(cctx_T *cctx, char_u *str) | 1008 generate_PUSHS(cctx_T *cctx, char_u *str) |
1009 { | 1009 { |
1010 isn_T *isn; | 1010 isn_T *isn; |
1011 | 1011 |
1012 RETURN_OK_IF_SKIP(cctx); | 1012 if (cctx->ctx_skip == SKIP_YES) |
1013 { | |
1014 vim_free(str); | |
1015 return OK; | |
1016 } | |
1013 if ((isn = generate_instr_type(cctx, ISN_PUSHS, &t_string)) == NULL) | 1017 if ((isn = generate_instr_type(cctx, ISN_PUSHS, &t_string)) == NULL) |
1014 return FAIL; | 1018 return FAIL; |
1015 isn->isn_arg.string = str; | 1019 isn->isn_arg.string = str; |
1016 | 1020 |
1017 return OK; | 1021 return OK; |