summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorLibravatar Pierre Habouzit <madcoder@debian.org>2007-09-16 00:32:36 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-09-18 17:42:17 -0700
commit182af8343c307436bb5364309aa6d4d46fa5911d (patch)
tree154c50047e12595027a0d61f54bfdd6ecd2305a5 /connect.c
parentMerge branch 'master' into ph/strbuf (diff)
downloadtgif-182af8343c307436bb5364309aa6d4d46fa5911d.tar.xz
Use xmemdupz() in many places.
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/connect.c b/connect.c
index 8b1e9935a8..1653a0ef7f 100644
--- a/connect.c
+++ b/connect.c
@@ -393,9 +393,7 @@ static int git_proxy_command_options(const char *var, const char *value)
if (matchlen == 4 &&
!memcmp(value, "none", 4))
matchlen = 0;
- git_proxy_command = xmalloc(matchlen + 1);
- memcpy(git_proxy_command, value, matchlen);
- git_proxy_command[matchlen] = 0;
+ git_proxy_command = xmemdupz(value, matchlen);
}
return 0;
}