summaryrefslogtreecommitdiff
path: root/http-backend.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-21 12:35:39 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-21 12:35:39 -0700
commit9ab08822556c49a7856dadd0e9a42f9ec2aaf850 (patch)
treef52f20367d13f2078fe6199e230322c899b9308d /http-backend.c
parent0eff86e4f440fedf26f02f4c3b1a3ead8bfbe6f8 (diff)
parent5c0b13f85ab3a5326508b854768eb70c8829cda4 (diff)
downloadgit-9ab08822556c49a7856dadd0e9a42f9ec2aaf850.tar.gz
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 'http-backend.c')
-rw-r--r--http-backend.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/http-backend.c b/http-backend.c
index 57290d9bda..80790bbaef 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -610,9 +610,7 @@ int main(int argc, char **argv)
cmd = c;
n = out[0].rm_eo - out[0].rm_so;
- cmd_arg = xmalloc(n);
- memcpy(cmd_arg, dir + out[0].rm_so + 1, n-1);
- cmd_arg[n-1] = '\0';
+ cmd_arg = xmemdupz(dir + out[0].rm_so + 1, n - 1);
dir[out[0].rm_so] = 0;
break;
}