diff options
| author | Pavel Knoblokh <info@software-advisory.com.au> | 2026-02-05 03:59:21 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2026-02-05 03:59:21 +0000 |
| commit | abf911af22729858cc876231e7970eff6aefbb9d (patch) | |
| tree | 7e28697be92af3ea7a1ccf31acf9b88368faff87 | |
| parent | 2e020c84cb5ee1452e448f27ff7a7b6076c0147a (diff) | |
pkg: Fix mirror type parsing and service discovery
Signed-off-by: Pavel Knoblokh <info@software-advisory.com.au>
Reviewed by: emaste, imp, kevans
Fixes: dc4581589a3 ("pkg: clean support for repositories")
Closes: https://github.com/freebsd/freebsd-src/pull/1989
| -rw-r--r-- | usr.sbin/pkg/config.c | 3 | ||||
| -rw-r--r-- | usr.sbin/pkg/pkg.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 6649e75b7f6b..8405a4c658fb 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 7b0a67e69a4c..33a404474cf2 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -334,6 +334,12 @@ fetchfail: } cleanup: + fetchFreeURL(u); + while (mirrors != NULL) { + current = mirrors; + mirrors = mirrors->next; + free(current); + } if (remote != NULL) fclose(remote); |
