patch 8.1.0377: xdiff doesn't use the Vim memory allocation functions

Problem:    Xdiff doesn't use the Vim memory allocation functions.
Solution:   Change the xdl_ defines.  Check for out-of-memory.  Rename
            "ignored" to "vim_ignored".
diff --git a/src/xdiff/xdiff.h b/src/xdiff/xdiff.h
index 2356da5..476b20c 100644
--- a/src/xdiff/xdiff.h
+++ b/src/xdiff/xdiff.h
@@ -108,10 +108,11 @@
 	long bsize;
 } bdiffparam_t;
 
+#include "vim.h"
 
-#define xdl_malloc(x) malloc(x)
-#define xdl_free(ptr) free(ptr)
-#define xdl_realloc(ptr,x) realloc(ptr,x)
+#define xdl_malloc(x) lalloc((x), TRUE)
+#define xdl_free(ptr) vim_free(ptr)
+#define xdl_realloc(ptr,x) vim_realloc((ptr),(x))
 
 void *xdl_mmfile_first(mmfile_t *mmf, long *size);
 long xdl_mmfile_size(mmfile_t *mmf);
diff --git a/src/xdiff/xdiffi.c b/src/xdiff/xdiffi.c
index 3dc90ae..96d5277 100644
--- a/src/xdiff/xdiffi.c
+++ b/src/xdiff/xdiffi.c
@@ -392,9 +392,9 @@
 }
 
 /*
- * If a line is indented more than this, get_indent() just returns this value.
+ * If a line is indented more than this, xget_indent() just returns this value.
  * This avoids having to do absurd amounts of work for data that are not
- * human-readable text, and also ensures that the output of get_indent fits within
+ * human-readable text, and also ensures that the output of xget_indent fits within
  * an int.
  */
 #define MAX_INDENT 200
@@ -404,7 +404,7 @@
  * columns. Return -1 if line is empty or contains only whitespace. Clamp the
  * output value at MAX_INDENT.
  */
-static int get_indent(xrecord_t *rec)
+static int xget_indent(xrecord_t *rec)
 {
 	long i;
 	int ret = 0;
@@ -492,13 +492,13 @@
 		m->indent = -1;
 	} else {
 		m->end_of_file = 0;
-		m->indent = get_indent(xdf->recs[split]);
+		m->indent = xget_indent(xdf->recs[split]);
 	}
 
 	m->pre_blank = 0;
 	m->pre_indent = -1;
 	for (i = split - 1; i >= 0; i--) {
-		m->pre_indent = get_indent(xdf->recs[i]);
+		m->pre_indent = xget_indent(xdf->recs[i]);
 		if (m->pre_indent != -1)
 			break;
 		m->pre_blank += 1;
@@ -511,7 +511,7 @@
 	m->post_blank = 0;
 	m->post_indent = -1;
 	for (i = split + 1; i < xdf->nrec; i++) {
-		m->post_indent = get_indent(xdf->recs[i]);
+		m->post_indent = xget_indent(xdf->recs[i]);
 		if (m->post_indent != -1)
 			break;
 		m->post_blank += 1;
diff --git a/src/xdiff/xpatience.c b/src/xdiff/xpatience.c
index 1052d10..c187129 100644
--- a/src/xdiff/xpatience.c
+++ b/src/xdiff/xpatience.c
@@ -210,6 +210,10 @@
 	int longest = 0, i;
 	struct entry *entry;
 
+	/* Added to silence Coverity. */
+	if (sequence == NULL)
+		return map->first;
+
 	/*
 	 * If not -1, this entry in sequence must never be overridden.
 	 * Therefore, overriding entries before this has no effect, so