The branch main has been updated by kevans:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=abf911af22729858cc876231e7970eff6aefbb9d

commit abf911af22729858cc876231e7970eff6aefbb9d
Author:     Pavel Knoblokh <[email protected]>
AuthorDate: 2026-02-05 03:59:21 +0000
Commit:     Kyle Evans <[email protected]>
CommitDate: 2026-02-05 03:59:21 +0000

    pkg: Fix mirror type parsing and service discovery
    
    Signed-off-by: Pavel Knoblokh <[email protected]>
    Reviewed by:    emaste, imp, kevans
    Fixes:          dc4581589a3 ("pkg: clean support for repositories")
    Closes:         https://github.com/freebsd/freebsd-src/pull/1989
---
 usr.sbin/pkg/config.c | 3 ++-
 usr.sbin/pkg/pkg.c    | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

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);
 

Reply via email to