summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c
index e3e7da824..707abf8d5 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3431,10 +3431,14 @@ get_keystroke()
buf = alloc(buflen);
else if (maxlen < 10)
{
+ char_u *t_buf = buf;
+
/* Need some more space. This might happen when receiving a long
* escape sequence. */
buflen += 100;
buf = vim_realloc(buf, buflen);
+ if (buf == NULL)
+ vim_free(t_buf);
maxlen = (buflen - 6 - len) / 3;
}
if (buf == NULL)