Mercurial > vim
comparison src/map.c @ 27243:c072eed37deb v8.2.4150
patch 8.2.4150: Coverity warns for using pointer after free
Commit: https://github.com/vim/vim/commit/8aa0e6c60da5f7a4b04eaead40d183fd8e5640a4
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 20 11:27:58 2022 +0000
patch 8.2.4150: Coverity warns for using pointer after free
Problem: Coverity warns for using pointer after free.
Solution: Swap statements, even though using the pointer is no problem.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 20 Jan 2022 12:30:07 +0100 |
parents | bd072d44eb2c |
children | fb4c30606b4a |
comparison
equal
deleted
inserted
replaced
27242:e139c2b97da7 | 27243:c072eed37deb |
---|---|
82 mp = *mpp; | 82 mp = *mpp; |
83 vim_free(mp->m_keys); | 83 vim_free(mp->m_keys); |
84 vim_free(mp->m_str); | 84 vim_free(mp->m_str); |
85 vim_free(mp->m_orig_str); | 85 vim_free(mp->m_orig_str); |
86 *mpp = mp->m_next; | 86 *mpp = mp->m_next; |
87 vim_free(mp); | |
88 #ifdef FEAT_EVAL | 87 #ifdef FEAT_EVAL |
89 reset_last_used_map(mp); | 88 reset_last_used_map(mp); |
90 #endif | 89 #endif |
90 vim_free(mp); | |
91 } | 91 } |
92 | 92 |
93 /* | 93 /* |
94 * Return characters to represent the map mode in an allocated string. | 94 * Return characters to represent the map mode in an allocated string. |
95 * Returns NULL when out of memory. | 95 * Returns NULL when out of memory. |