diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index 0aaebbdb..d057ea34 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -871,7 +871,10 @@ write_content_object (OstreeRepo *self, /* Give a null input if there's no content */ g_autoptr(GInputStream) null_input = NULL; if (!input) - null_input = input = g_memory_input_stream_new_from_data ("", 0, NULL); + { + null_input = input = g_memory_input_stream_new_from_data ("", 0, NULL); + (void) null_input; /* quiet static analysis */ + } checksum_input = ot_checksum_instream_new_with_start (input, G_CHECKSUM_SHA256, buf, len); diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index b654aff2..e2998f73 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -4197,7 +4197,7 @@ ostree_repo_has_object (OstreeRepo *self, GCancellable *cancellable, GError **error) { - gboolean ret_have_object; + gboolean ret_have_object = FALSE; if (!_ostree_repo_has_loose_object (self, checksum, objtype, &ret_have_object, cancellable, error)) diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index c342d7e0..6507b2c5 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -753,15 +753,14 @@ prepare_deployment_etc (OstreeSysroot *sysroot, return FALSE; gboolean usretc_exists = (errno == 0); - if (etc_exists && usretc_exists) - return glnx_throw (error, "Tree contains both /etc and /usr/etc"); - else if (etc_exists) + if (etc_exists) { + if (usretc_exists) + return glnx_throw (error, "Tree contains both /etc and /usr/etc"); /* Compatibility hack */ if (!glnx_renameat (deployment_dfd, "etc", deployment_dfd, "usr/etc", error)) return FALSE; usretc_exists = TRUE; - etc_exists = FALSE; } if (usretc_exists) diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c index 2c0c0546..e17cc233 100644 --- a/src/libostree/ostree-sysroot.c +++ b/src/libostree/ostree-sysroot.c @@ -1671,10 +1671,7 @@ ostree_sysroot_simple_write_deployment (OstreeSysroot *sysroot, /* add it last if no crossover defined (or it's the first deployment in the sysroot) */ if (!added_new) - { - g_ptr_array_add (new_deployments, g_object_ref (new_deployment)); - added_new = TRUE; - } + g_ptr_array_add (new_deployments, g_object_ref (new_deployment)); OstreeSysrootWriteDeploymentsOpts write_opts = { .do_postclean = postclean }; if (!ostree_sysroot_write_deployments_with_options (sysroot, new_deployments, &write_opts,