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

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