fetcher/soup: 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-fetcher-soup.c

index 5f707175b2ce0d811a5b8fea5da3f152c714314f..7df4848236af6df7292cef3de09dab1562fb21aa 100644 (file)
@@ -183,7 +183,7 @@ static OstreeFetcherPendingURI *
 pending_uri_ref (OstreeFetcherPendingURI *pending)
 {
   gint refcount;
-  g_return_val_if_fail (pending != NULL, NULL);
+  g_assert (pending);
   refcount = g_atomic_int_add (&pending->ref_count, 1);
   g_assert (refcount > 0);
   return pending;