summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorLibravatar Jonas Fonseca <fonseca@diku.dk>2006-09-01 00:32:39 +0200
committerLibravatar Junio C Hamano <junkio@cox.net>2006-08-31 16:24:39 -0700
commit2d7320d0b09d7a9aab4e5dbc5458f37bfb6ce9f5 (patch)
tree4fac98b5cb3155365498f5750f9550be977660ed /merge-recursive.c
parentgit(7): move gitk(1) to the list of porcelain commands (diff)
downloadtgif-2d7320d0b09d7a9aab4e5dbc5458f37bfb6ce9f5.tar.xz
Use xmalloc instead of malloc
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 39a1eae894..48b2763de6 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -283,7 +283,7 @@ static int save_files_dirs(const unsigned char *sha1,
unsigned int mode, int stage)
{
int len = strlen(path);
- char *newpath = malloc(baselen + len + 1);
+ char *newpath = xmalloc(baselen + len + 1);
memcpy(newpath, base, baselen);
memcpy(newpath + baselen, path, len);
newpath[baselen + len] = '\0';
@@ -455,7 +455,7 @@ static int remove_path(const char *name)
if (ret)
return ret;
len = strlen(name);
- dirs = malloc(len+1);
+ dirs = xmalloc(len+1);
memcpy(dirs, name, len);
dirs[len] = '\0';
while ((slash = strrchr(name, '/'))) {
@@ -572,7 +572,7 @@ void update_file_flags(const unsigned char *sha,
flush_buffer(fd, buf, size);
close(fd);
} else if (S_ISLNK(mode)) {
- char *lnk = malloc(size + 1);
+ char *lnk = xmalloc(size + 1);
memcpy(lnk, buf, size);
lnk[size] = '\0';
mkdir_p(path, 0777);