deltas: Fix leak of matches
authorColin Walters <walters@verbum.org>
Tue, 2 Feb 2021 21:03:53 +0000 (21:03 +0000)
committerColin Walters <walters@verbum.org>
Tue, 2 Feb 2021 21:26:43 +0000 (21:26 +0000)
Found by ASAN.

src/libostree/ostree-repo-static-delta-compilation.c

index 893ce2fa42317a6c20c355ca7866b467df5b782e..0f0828f778213d8d5c70ec5f5ed96bf8ec7ab434 100644 (file)
@@ -636,7 +636,7 @@ try_content_rollsum (OstreeRepo                       *repo,
   if (!get_unpacked_unlinked_content (repo, to, &tmp_to, cancellable, error))
     return FALSE;
 
-  OstreeRollsumMatches *matches = _ostree_compute_rollsum_matches (tmp_from, tmp_to);
+  g_autoptr(OstreeRollsumMatches) matches = _ostree_compute_rollsum_matches (tmp_from, tmp_to);
 
   const guint match_ratio = (matches->bufmatches*100)/matches->total;