diff options
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/transport.c b/transport.c index 70d38e4c4..08bcd3a4e 100644 --- a/transport.c +++ b/transport.c @@ -971,9 +971,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); } |