]> asedeno.scripts.mit.edu Git - git.git/blobdiff - connect.c
Use xmemdupz() in many places.
[git.git] / connect.c
index 8b1e9935a85b639f6c48298d07299f72bceaad29..1653a0ef7f7b4fa529a7755aae070c1716dd8e24 100644 (file)
--- 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;
        }