deployment: Fix gcc `-fanalyzer` warning
authorColin Walters <walters@verbum.org>
Fri, 8 Oct 2021 12:59:52 +0000 (08:59 -0400)
committerColin Walters <walters@verbum.org>
Wed, 13 Oct 2021 21:13:14 +0000 (17:13 -0400)
In general, we're probably going to need to change most of our
`g_return_if_fail` to `g_assert`.  The analyzer flags that
the function can return `NULL`, but the caller isn't prepared for
this.

In practice, let's abort.

src/libostree/ostree-deployment.c

index 558434dead2041a0b43441a9cf36f271200101af..6397d7868f640e73664d37a6b579690fb471efda 100644 (file)
@@ -374,9 +374,9 @@ ostree_deployment_new (int    index,
   OstreeDeployment *self;
 
   /* index may be -1 */
-  g_return_val_if_fail (osname != NULL, NULL);
-  g_return_val_if_fail (csum != NULL, NULL);
-  g_return_val_if_fail (deployserial >= 0, NULL);
+  g_assert (osname != NULL);
+  g_assert (csum != NULL);
+  g_assert (deployserial >= 0);
   /* We can have "disconnected" deployments that don't have a
      bootcsum/serial */