remote: 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.
This commit is contained in:
Colin Walters 2021-10-08 08:59:52 -04:00
parent 16157e77e5
commit a8eed03a19

View File

@ -65,8 +65,8 @@ ostree_remote_new_dynamic (const gchar *name,
{
OstreeRemote *remote;
g_return_val_if_fail (name != NULL && *name != '\0', NULL);
g_return_val_if_fail (refspec_name == NULL || *refspec_name != '\0', NULL);
g_assert (name != NULL && *name != '\0');
g_assert (refspec_name == NULL || *refspec_name != '\0');
remote = g_slice_new0 (OstreeRemote);
remote->ref_count = 1;