1
0
forked from aniani/vim

patch 8.1.1895: using NULL pointer when out of memory

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)
This commit is contained in:
Bram Moolenaar
2019-08-20 22:58:37 +02:00
parent 1058c9d9b5
commit 6f10c70b59
5 changed files with 35 additions and 12 deletions

View File

@@ -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;