diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 6649e75b7f6..8405a4c658f 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -328,7 +328,8 @@ parse_mirror_type(struct repository *r, const char *mt) { if (strcasecmp(mt, "srv") == 0) r->mirror_type = MIRROR_SRV; - r->mirror_type = MIRROR_NONE; + else + r->mirror_type = MIRROR_NONE; } static void diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 7b0a67e69a4..33a404474cf 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -334,6 +334,12 @@ fetch_to_fd(struct repository *repo, const char *url, char *path, const char *fe } cleanup: + fetchFreeURL(u); + while (mirrors != NULL) { + current = mirrors; + mirrors = mirrors->next; + free(current); + } if (remote != NULL) fclose(remote);