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)
diff --git a/src/ops.c b/src/ops.c
index 7ede1f7..7b1d9ed 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -4556,6 +4556,11 @@
/* allocate the space for the new line */
newp = alloc(sumsize + 1);
+ if (newp == NULL)
+ {
+ ret = FAIL;
+ goto theend;
+ }
cend = newp + sumsize;
*cend = 0;