From: Colin Walters Date: Sat, 26 Aug 2023 16:18:48 +0000 (-0400) Subject: lib/repo-finder: Squash memory leak X-Git-Tag: archive/raspbian/2023.7-3+rpi1^2~16^2^2~39^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0cfa5e86004bd5f79fe87155bc3448a60993e0e6;p=ostree.git lib/repo-finder: Squash memory leak We want to free this value on each iteration; it's moved below if the value is used. --- 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);