From 0cfa5e86004bd5f79fe87155bc3448a60993e0e6 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 26 Aug 2023 12:18:48 -0400 Subject: [PATCH] lib/repo-finder: Squash memory leak We want to free this value on each iteration; it's moved below if the value is used. --- src/libostree/ostree-repo-finder-mount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libostree/ostree-repo-finder-mount.c b/src/libostree/ostree-repo-finder-mount.c index 19583090..3f92b278 100644 --- a/src/libostree/ostree-repo-finder-mount.c +++ b/src/libostree/ostree-repo-finder-mount.c @@ -438,7 +438,6 @@ ostree_repo_finder_mount_resolve_async (OstreeRepoFinder *finder, { const OstreeCollectionRef *ref = refs[i]; g_autofree gchar *resolved_repo_uri = NULL; - g_autoptr (UriAndKeyring) resolved_repo = NULL; for (gsize j = 0; j < repos_refs->len; j++) { @@ -484,7 +483,8 @@ ostree_repo_finder_mount_resolve_async (OstreeRepoFinder *finder, ref->collection_id, ref->ref_name, mount_name, resolved_repo_uri, keyring_remote->keyring, keyring_remote->name); - resolved_repo = uri_and_keyring_new (resolved_repo_uri, keyring_remote); + g_autoptr (UriAndKeyring) resolved_repo + = uri_and_keyring_new (resolved_repo_uri, keyring_remote); supported_ref_to_checksum = g_hash_table_lookup (repo_to_refs, resolved_repo); -- 2.30.2