diff options
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c index 3f70b1d86a..c08c0cbea8 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -350,7 +350,7 @@ static void link_alt_odb_entries(const char *alt, int len, int sep, return; } - strbuf_addstr(&objdirbuf, absolute_path(get_object_directory())); + strbuf_add_absolute_path(&objdirbuf, get_object_directory()); normalize_path_copy(objdirbuf.buf, objdirbuf.buf); alt_copy = xmemdupz(alt, len); @@ -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; |