Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Fonseca <fonseca@diku.dk>2006-09-01 02:32:39 +0400
committerJunio C Hamano <junkio@cox.net>2006-09-01 03:24:39 +0400
commit2d7320d0b09d7a9aab4e5dbc5458f37bfb6ce9f5 (patch)
tree4fac98b5cb3155365498f5750f9550be977660ed /merge-recursive.c
parentef1186228d39af29c109785fa752e3866c79a6b3 (diff)
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);