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.
diff --git a/src/getchar.c b/src/getchar.c
index 5b5b3ed..e82155f 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4523,10 +4523,12 @@
if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
{
+ char_u *qe = vim_strsave(mp->m_keys);
+
/* might have CSI escaped mp->m_keys */
- q = vim_strsave(mp->m_keys);
- if (q != NULL)
+ if (qe != NULL)
{
+ q = qe;
vim_unescape_csi(q);
qlen = (int)STRLEN(q);
}