Mercurial > vim
comparison src/getchar.c @ 13908:b7ca1a8db3e8 v8.0.1825
patch 8.0.1825: might use NULL pointer when out of memory
commit https://github.com/vim/vim/commit/dd1d7be4e6691f447667a8217844a3b2561203be
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 12 21:34:58 2018 +0200
patch 8.0.1825: might use NULL pointer when out of memory
Problem: Might use NULL pointer when out of memory. (Coverity)
Solution: Handle NULL pointer better.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 12 May 2018 21:45:05 +0200 |
parents | 044337cbf854 |
children | 741b1feeac9f |
comparison
equal
deleted
inserted
replaced
13907:40befa728594 | 13908:b7ca1a8db3e8 |
---|---|
4521 char_u *q = mp->m_keys; | 4521 char_u *q = mp->m_keys; |
4522 int match; | 4522 int match; |
4523 | 4523 |
4524 if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL) | 4524 if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL) |
4525 { | 4525 { |
4526 char_u *qe = vim_strsave(mp->m_keys); | |
4527 | |
4526 /* might have CSI escaped mp->m_keys */ | 4528 /* might have CSI escaped mp->m_keys */ |
4527 q = vim_strsave(mp->m_keys); | 4529 if (qe != NULL) |
4528 if (q != NULL) | |
4529 { | 4530 { |
4531 q = qe; | |
4530 vim_unescape_csi(q); | 4532 vim_unescape_csi(q); |
4531 qlen = (int)STRLEN(q); | 4533 qlen = (int)STRLEN(q); |
4532 } | 4534 } |
4533 } | 4535 } |
4534 | 4536 |