Commit 899fd4c5e2d43fb0775044a34a330763d2ba0228

Edward Thomson 2022-02-18T09:30:05

Merge pull request #6223 from libgit2/ethomson/xdiff xdiff: use xdl_free not free

diff --git a/src/xdiff/xdiff.h b/src/xdiff/xdiff.h
index a7bf17c..fb47f63 100644
--- a/src/xdiff/xdiff.h
+++ b/src/xdiff/xdiff.h
@@ -23,12 +23,12 @@
 #if !defined(XDIFF_H)
 #define XDIFF_H
 
-#include "git-xdiff.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif /* #ifdef __cplusplus */
 
+#include "git-xdiff.h"
+
 /* xpparm_t.flags */
 #define XDF_NEED_MINIMAL (1 << 0)
 
diff --git a/src/xdiff/xmerge.c b/src/xdiff/xmerge.c
index fff0b59..433e2d7 100644
--- a/src/xdiff/xmerge.c
+++ b/src/xdiff/xmerge.c
@@ -88,7 +88,7 @@ static int xdl_cleanup_merge(xdmerge_t *c)
 		if (c->mode == 0)
 			count++;
 		next_c = c->next;
-		free(c);
+		xdl_free(c);
 	}
 	return count;
 }
@@ -456,7 +456,7 @@ static void xdl_merge_two_conflicts(xdmerge_t *m)
 	m->chg1 = next_m->i1 + next_m->chg1 - m->i1;
 	m->chg2 = next_m->i2 + next_m->chg2 - m->i2;
 	m->next = next_m->next;
-	free(next_m);
+	xdl_free(next_m);
 }
 
 /*