summaryrefslogtreecommitdiff
path: root/src/ops.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-20 22:58:37 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-20 22:58:37 +0200
commit6f10c70b59fa4e56aa479345fb0caeaac7429bfb (patch)
treecdbb54c3b73a4607d8bdebb116c962bb044246f5 /src/ops.c
parent1058c9d9b5815467182d487f10f6dd71385cb796 (diff)
downloadvim-git-6f10c70b59fa4e56aa479345fb0caeaac7429bfb.tar.gz
patch 8.1.1895: using NULL pointer when out of memoryv8.1.1895
Problem: Using NULL pointer when out of memory. Solution: Bail out or skip the code using the pointer. (Zu-Ming Jiang, closes #4805, closes #4843, closes #4939, closes #4844)
Diffstat (limited to 'src/ops.c')
-rw-r--r--src/ops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ops.c b/src/ops.c
index 7ede1f73a..7b1d9ede7 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -4556,6 +4556,11 @@ do_join(
/* allocate the space for the new line */
newp = alloc(sumsize + 1);
+ if (newp == NULL)
+ {
+ ret = FAIL;
+ goto theend;
+ }
cend = newp + sumsize;
*cend = 0;