mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 13:06:14 +01:00
gboxed: Fix two potential NULL pointer dereferences
I don’t think these could be hit in practice due to the guarantees of the type system, but the static analyser doesn’t know that — so make the assertions clearer to shut it up. Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #1767
This commit is contained in:
parent
8fe58ffe12
commit
8f52d2cb02
@ -346,8 +346,7 @@ g_boxed_copy (GType boxed_type,
|
||||
g_return_val_if_fail (src_boxed != NULL, NULL);
|
||||
|
||||
value_table = g_type_value_table_peek (boxed_type);
|
||||
if (!value_table)
|
||||
g_return_val_if_fail (G_TYPE_IS_VALUE_TYPE (boxed_type), NULL);
|
||||
g_assert (value_table != NULL);
|
||||
|
||||
/* check if our proxying implementation is used, we can short-cut here */
|
||||
if (value_table->value_copy == boxed_proxy_value_copy)
|
||||
@ -404,8 +403,7 @@ g_boxed_free (GType boxed_type,
|
||||
g_return_if_fail (boxed != NULL);
|
||||
|
||||
value_table = g_type_value_table_peek (boxed_type);
|
||||
if (!value_table)
|
||||
g_return_if_fail (G_TYPE_IS_VALUE_TYPE (boxed_type));
|
||||
g_assert (value_table != NULL);
|
||||
|
||||
/* check if our proxying implementation is used, we can short-cut here */
|
||||
if (value_table->value_free == boxed_proxy_value_free)
|
||||
|
Loading…
Reference in New Issue
Block a user