diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-11 10:33:32 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-11 10:33:33 -0700 |
commit | bedd3b4b7b25df0b994abf444ee2136995dfeffa (patch) | |
tree | 1f5866f73cce9cf92d602f8d61fb6a52d1c3d3c9 /sha1_file.c | |
parent | 08ad26a63deaa7eaaaa987ed2cc84ac0f83c080b (diff) | |
parent | 1aaf69e669b7fd67073d3024b386ac25ac77d0f8 (diff) | |
download | git-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.c | 4 |
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; |