vendor/libgit2/src/net.c in rugged-1.0.1 vs vendor/libgit2/src/net.c in rugged-1.1.0
- old
+ new
@@ -334,10 +334,15 @@
return (url->host && url->port && url->path);
}
int git_net_url_is_default_port(git_net_url *url)
{
- return (strcmp(url->port, default_port_for_scheme(url->scheme)) == 0);
+ const char *default_port;
+
+ if ((default_port = default_port_for_scheme(url->scheme)) != NULL)
+ return (strcmp(url->port, default_port) == 0);
+ else
+ return false;
}
void git_net_url_swap(git_net_url *a, git_net_url *b)
{
git_net_url tmp = GIT_NET_URL_INIT;