diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-21 12:35:39 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-21 12:35:39 -0700 |
commit | 9ab08822556c49a7856dadd0e9a42f9ec2aaf850 (patch) | |
tree | f52f20367d13f2078fe6199e230322c899b9308d /builtin/blame.c | |
parent | Ninth batch for 2.1 (diff) | |
parent | use xmemdupz() to allocate copies of strings given by start and length (diff) | |
download | tgif-9ab08822556c49a7856dadd0e9a42f9ec2aaf850.tar.xz |
Merge branch 'maint'
* maint:
use xmemdupz() to allocate copies of strings given by start and length
use xcalloc() to allocate zero-initialized memory
Diffstat (limited to 'builtin/blame.c')
-rw-r--r-- | builtin/blame.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/blame.c b/builtin/blame.c index c59e702021..32ce05f615 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -2707,11 +2707,8 @@ parse_done: die("revision walk setup failed"); if (is_null_sha1(sb.final->object.sha1)) { - char *buf; o = sb.final->util; - buf = xmalloc(o->file.size + 1); - memcpy(buf, o->file.ptr, o->file.size + 1); - sb.final_buf = buf; + sb.final_buf = xmemdupz(o->file.ptr, o->file.size); sb.final_buf_size = o->file.size; } else { |