Now that hostandport is left unmodified in git_connect (we don't pass
it to get_host_and_port() anymore), we can avoid xstrdup'ing it.

Signed-off-by: Mike Hommey <m...@glandium.org>
---
 connect.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/connect.c b/connect.c
index b3fce84..e2b976e 100644
--- a/connect.c
+++ b/connect.c
@@ -683,9 +683,9 @@ struct child_process *git_connect(int fd[2], const char 
*url,
                 */
                char *target_host = getenv("GIT_OVERRIDE_VIRTUAL_HOST");
                if (target_host)
-                       target_host = xstrdup(target_host);
+                       target_host = target_host;
                else
-                       target_host = xstrdup(hostandport);
+                       target_host = hostandport;
 
                transport_check_allowed("git");
 
@@ -707,7 +707,6 @@ struct child_process *git_connect(int fd[2], const char 
*url,
                             "%s %s%chost=%s%c",
                             prog, path, 0,
                             target_host, 0);
-               free(target_host);
        } else {
                conn = xmalloc(sizeof(*conn));
                child_process_init(conn);
-- 
2.8.1.16.g58dac65.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to