summaryrefslogtreecommitdiff
path: root/xdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-04-25 16:41:23 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-04-25 16:41:23 +0900
commit449f2db75dd990d5b1157c7d4da49f046eab27c6 (patch)
tree0c33f05bab8cf9a08b6d08f7c8d4bb0cacbc5e5e /xdiff
parentMerge branch 'km/t3000-retitle' (diff)
parentprogress: use xmalloc/xcalloc (diff)
downloadtgif-449f2db75dd990d5b1157c7d4da49f046eab27c6.tar.xz
Merge branch 'jk/xmalloc'
The code is updated to check the result of memory allocation before it is used in more places, by using xmalloc and/or xcalloc calls. * jk/xmalloc: progress: use xmalloc/xcalloc xdiff: use xmalloc/xrealloc xdiff: use git-compat-util test-prio-queue: use xmalloc
Diffstat (limited to 'xdiff')
-rw-r--r--xdiff/xdiff.h4
-rw-r--r--xdiff/xinclude.h8
2 files changed, 3 insertions, 9 deletions
diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h
index b158369020..032e3a9f41 100644
--- a/xdiff/xdiff.h
+++ b/xdiff/xdiff.h
@@ -113,9 +113,9 @@ typedef struct s_bdiffparam {
} bdiffparam_t;
-#define xdl_malloc(x) malloc(x)
+#define xdl_malloc(x) xmalloc(x)
#define xdl_free(ptr) free(ptr)
-#define xdl_realloc(ptr,x) realloc(ptr,x)
+#define xdl_realloc(ptr,x) xrealloc(ptr,x)
void *xdl_mmfile_first(mmfile_t *mmf, long *size);
long xdl_mmfile_size(mmfile_t *mmf);
diff --git a/xdiff/xinclude.h b/xdiff/xinclude.h
index f35c4485df..a4285ac0eb 100644
--- a/xdiff/xinclude.h
+++ b/xdiff/xinclude.h
@@ -23,13 +23,7 @@
#if !defined(XINCLUDE_H)
#define XINCLUDE_H
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <limits.h>
-
+#include "git-compat-util.h"
#include "xmacros.h"
#include "xdiff.h"
#include "xtypes.h"