From b079c11381aa2b297652753d346b12b8112ef542 Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Wed, 18 Aug 2021 09:06:26 +0000 Subject: [PATCH] builtins/commit: move commit modifier to auto-cleanup This reduces the usage of goto cleanup logic by porting the commit modifier pointer to autoptr. --- src/ostree/ot-builtin-commit.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c index 7a23741e..2663bd1c 100644 --- a/src/ostree/ot-builtin-commit.c +++ b/src/ostree/ot-builtin-commit.c @@ -432,7 +432,7 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio g_autoptr(GHashTable) skip_list = NULL; OstreeRepoCommitModifierFlags flags = 0; g_autoptr(OstreeSePolicy) policy = NULL; - OstreeRepoCommitModifier *modifier = NULL; + g_autoptr(OstreeRepoCommitModifier) modifier = NULL; OstreeRepoTransactionStats stats; struct CommitFilterData filter_data = { 0, }; g_autofree char *commit_body = NULL; @@ -968,7 +968,5 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio out: if (repo) ostree_repo_abort_transaction (repo, cancellable, NULL); - if (modifier) - ostree_repo_commit_modifier_unref (modifier); return ret; }