cmd_push: pass "flags" pointer to config callback
[gitweb.git] / transport.c
index 1373152a93b281bdaa24b65c458a359d1ddfaf4f..0694a7cf3e4a8bd7bec9fefcd440d65423021a1b 100644 (file)
@@ -976,9 +976,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
        } else {
                /* Unknown protocol in URL. Pass to external handler. */
                int len = external_specification_len(url);
-               char *handler = xmalloc(len + 1);
-               handler[len] = 0;
-               strncpy(handler, url, len);
+               char *handler = xmemdupz(url, len);
                transport_helper_init(ret, handler);
        }