From: Colin Walters Date: Fri, 8 Oct 2021 12:59:52 +0000 (-0400) Subject: fetcher/soup: Fix gcc `-fanalyzer` warning X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2^2~16^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3159e04980e567a918e532e168dea89112922460;p=ostree.git fetcher/soup: Fix gcc `-fanalyzer` warning 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. --- diff --git a/src/libostree/ostree-fetcher-soup.c b/src/libostree/ostree-fetcher-soup.c index 5f707175..7df48482 100644 --- a/src/libostree/ostree-fetcher-soup.c +++ b/src/libostree/ostree-fetcher-soup.c @@ -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;