From 1eab48363ba385cba5d57aa09e5a7218d12f25b5 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 18 Aug 2020 23:34:57 +0000 Subject: [PATCH] pull: Assign idle_src variable before calling unref() This should pacify Coverity, and also just "reads" better too. --- src/libostree/ostree-repo-pull.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 894e4b1f..d817575b 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -436,8 +436,9 @@ ensure_idle_queued (OtPullData *pull_data) idle_src = g_idle_source_new (); g_source_set_callback (idle_src, idle_worker, pull_data, NULL); g_source_attach (idle_src, pull_data->main_context); - g_source_unref (idle_src); pull_data->idle_src = idle_src; + /* Ownership is transferred to pull_data */ + g_source_unref (idle_src); } typedef struct {