summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-11 10:33:32 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-11 10:33:33 -0700
commitbedd3b4b7b25df0b994abf444ee2136995dfeffa (patch)
tree1f5866f73cce9cf92d602f8d61fb6a52d1c3d3c9 /sha1_file.c
parent08ad26a63deaa7eaaaa987ed2cc84ac0f83c080b (diff)
parent1aaf69e669b7fd67073d3024b386ac25ac77d0f8 (diff)
downloadgit-bedd3b4b7b25df0b994abf444ee2136995dfeffa.tar.gz
Merge branch 'nd/large-blobs'
Teach a few codepaths to punt (instead of dying) when large blobs that would not fit in core are involved in the operation. * nd/large-blobs: diff: shortcut for diff'ing two binary SHA-1 objects diff --stat: mark any file larger than core.bigfilethreshold binary diff.c: allow to pass more flags to diff_populate_filespec sha1_file.c: do not die failing to malloc in unpack_compressed_entry wrapper.c: introduce gentle xmallocz that does not die()
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 95afd20910..c08c0cbea8 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1923,7 +1923,9 @@ static void *unpack_compressed_entry(struct packed_git *p,
git_zstream stream;
unsigned char *buffer, *in;
- buffer = xmallocz(size);
+ buffer = xmallocz_gently(size);
+ if (!buffer)
+ return NULL;
memset(&stream, 0, sizeof(stream));
stream.next_out = buffer;
stream.avail_out = size + 1;