mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
gvariant: Simplify GVariantType check in g_variant_format_string_scan_type()
Rather than returning through `G_VARIANT_TYPE`, which scan-build doesn’t seem to fully understand ownership transfers through, just return `new` directly, and do the `is_valid()` check separately. The new code is equivalent to the old code, but squashes a scan-build false positive around leaking `dest`. (See also: the previous commit.) Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #1767
This commit is contained in:
parent
156c1496ba
commit
b1bafda881
@ -4639,7 +4639,9 @@ g_variant_format_string_scan_type (const gchar *string,
|
||||
}
|
||||
new[i++] = '\0';
|
||||
|
||||
return (GVariantType *) G_VARIANT_TYPE (new);
|
||||
g_assert (g_variant_type_string_is_valid (new));
|
||||
|
||||
return (GVariantType *) new;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user