diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2017-07-16 17:28:14 +0200 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2017-07-16 17:48:50 +0200 |
commit | ffa2e4354986cc12b8d44781708f0b9d51b84f31 (patch) | |
tree | f490261d296502d7002a4fdca2d734b05e2ea1fa /src/nvim/quickfix.c | |
parent | c00300ecdd694cad53da74256e52675f79a3fd78 (diff) | |
download | rneovim-ffa2e4354986cc12b8d44781708f0b9d51b84f31.tar.gz rneovim-ffa2e4354986cc12b8d44781708f0b9d51b84f31.tar.bz2 rneovim-ffa2e4354986cc12b8d44781708f0b9d51b84f31.zip |
vim-patch:8.0.0078
Problem: Accessing freed memory in quickfix.
Solution: Reset pointer when freeing 'errorformat'. (Domenique Pelle)
https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 29beb35495..6814ca855b 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -383,6 +383,8 @@ static int efm_to_regpat(char_u *efm, int len, efm_T *fmt_ptr, return 0; } +static efm_T *fmt_start = NULL; // cached across qf_parse_line() calls + static void free_efm_list(efm_T **efm_first) { for (efm_T *efm_ptr = *efm_first; efm_ptr != NULL; efm_ptr = *efm_first) { @@ -390,6 +392,8 @@ static void free_efm_list(efm_T **efm_first) vim_regfree(efm_ptr->prog); xfree(efm_ptr); } + + fmt_start = NULL; } // Parse 'errorformat' option @@ -671,7 +675,6 @@ static int qf_parse_line(qf_info_T *qi, char_u *linebuf, size_t linelen, efm_T *fmt_first, qffields_T *fields) { efm_T *fmt_ptr; - static efm_T *fmt_start = NULL; // cached across calls size_t len; int i; int idx = 0; |