Use xmemdupz() in many places.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Pierre Habouzit
2007-09-16 00:32:36 +02:00
committed by Junio C Hamano
parent 39bd2eb56a
commit 182af8343c
23 changed files with 60 additions and 197 deletions

View File

@ -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;
}