summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo-pull.c
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2021-03-09 11:47:23 +0000
committerPhilip Withnall <pwithnall@endlessos.org>2021-03-09 11:47:23 +0000
commit60881b75ecb4166c89bb9b3392b5126557aaa6f0 (patch)
tree1014d95b91b90ee116540f2aefb45159843bcdc6 /src/libostree/ostree-repo-pull.c
parentf9a38436fa10c10f6904c138d28c96efd212bfb0 (diff)
downloadostree-60881b75ecb4166c89bb9b3392b5126557aaa6f0.tar.gz
ostree-repo-pull: Fix a leak of the summary data if loading from cache
If the `summary_sig_not_modified` branch is taken above, both `signatures` and `summary` are loaded from the cache. This makes the `_ostree_repo_load_cache_summary_if_same_sig()` call below redundant (it checks `signatures` matches the file it was just loaded from, and then loads `summary` again) — but that call also currently overwrites `summary` without clearing the old value. Fix this by only making that call if `signatures` was retrieved, but the server said the local `summary` cache was invalid. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Diffstat (limited to 'src/libostree/ostree-repo-pull.c')
-rw-r--r--src/libostree/ostree-repo-pull.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index a95190a5..6c5bffcf 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -6674,7 +6674,7 @@ ostree_repo_remote_fetch_summary_with_options (OstreeRepo *self,
return FALSE;
}
- if (signatures)
+ if (signatures && !summary)
{
if (!_ostree_repo_load_cache_summary_if_same_sig (self,
name,