Blame SOURCES/0004-repo-Correctly-initialize-refcount-of-temporary-tran.patch

b89242
From 51c7960bea081446ad217e9725408ce5cb531157 Mon Sep 17 00:00:00 2001
b89242
From: Simon McVittie <smcv@collabora.com>
b89242
Date: Sat, 30 Apr 2022 12:53:42 +0100
b89242
Subject: [PATCH 4/6] repo: Correctly initialize refcount of temporary
b89242
 transaction
b89242
b89242
Previously, the reference count was left uninitialized as a result of
b89242
bypassing the constructor, and the intended abort-on-error usually
b89242
wouldn't have happened.
b89242
b89242
Fixes: 8a9737a "repo/private: move OstreeRepoAutoTransaction to a boxed type"
b89242
Resolves: https://github.com/ostreedev/ostree/issues/2592
b89242
Signed-off-by: Simon McVittie <smcv@collabora.com>
b89242
(cherry picked from commit 71304e854cdb344adb8b1ae7866929fbdde6c327)
b89242
---
b89242
 src/libostree/ostree-repo-commit.c | 6 +++---
b89242
 1 file changed, 3 insertions(+), 3 deletions(-)
b89242
b89242
diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c
b89242
index 5b16be5b..dba98c32 100644
b89242
--- a/src/libostree/ostree-repo-commit.c
b89242
+++ b/src/libostree/ostree-repo-commit.c
b89242
@@ -1688,10 +1688,10 @@ ostree_repo_prepare_transaction (OstreeRepo     *self,
b89242
   g_debug ("Preparing transaction in repository %p", self);
b89242
 
b89242
   /* Set up to abort the transaction if we return early from this function.
b89242
-   * This needs to be manually built here due to a circular dependency. */
b89242
-  g_autoptr(OstreeRepoAutoTransaction) txn = g_malloc(sizeof(OstreeRepoAutoTransaction));
b89242
+   * We can't call _ostree_repo_auto_transaction_start() here, because that
b89242
+   * would be a circular dependency; use the lower-level version instead. */
b89242
+  g_autoptr(OstreeRepoAutoTransaction) txn = _ostree_repo_auto_transaction_new (self);
b89242
   g_assert (txn != NULL);
b89242
-  txn->repo = self;
b89242
 
b89242
   memset (&self->txn.stats, 0, sizeof (OstreeRepoTransactionStats));
b89242
 
b89242
-- 
b89242
2.31.1
b89242