mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-10 12:55:48 +01:00
Merge branch 'coverity' into 'master'
Minor memory leak fixes from Coverity See merge request GNOME/glib!184
This commit is contained in:
commit
bb8420f117
@ -106,6 +106,7 @@ handle_move (int argc, char *argv[], gboolean do_help)
|
|||||||
if (do_help)
|
if (do_help)
|
||||||
{
|
{
|
||||||
show_help (context, NULL);
|
show_help (context, NULL);
|
||||||
|
g_option_context_free (context);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2921,10 +2921,12 @@ g_settings_bind_with_mapping (GSettings *settings,
|
|||||||
|
|
||||||
if (!g_variant_type_equal (binding->key.type, G_VARIANT_TYPE_BOOLEAN))
|
if (!g_variant_type_equal (binding->key.type, G_VARIANT_TYPE_BOOLEAN))
|
||||||
{
|
{
|
||||||
|
gchar *type_string = g_variant_type_dup_string (binding->key.type);
|
||||||
g_critical ("g_settings_bind: G_SETTINGS_BIND_INVERT_BOOLEAN "
|
g_critical ("g_settings_bind: G_SETTINGS_BIND_INVERT_BOOLEAN "
|
||||||
"was specified, but key '%s' on schema '%s' has "
|
"was specified, but key '%s' on schema '%s' has "
|
||||||
"type '%s'", key, g_settings_schema_get_id (settings->priv->schema),
|
"type '%s'", key, g_settings_schema_get_id (settings->priv->schema),
|
||||||
g_variant_type_dup_string (binding->key.type));
|
type_string);
|
||||||
|
g_free (type_string);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2935,12 +2937,14 @@ g_settings_bind_with_mapping (GSettings *settings,
|
|||||||
!g_settings_mapping_is_compatible (binding->property->value_type,
|
!g_settings_mapping_is_compatible (binding->property->value_type,
|
||||||
binding->key.type))
|
binding->key.type))
|
||||||
{
|
{
|
||||||
|
gchar *type_string = g_variant_type_dup_string (binding->key.type);
|
||||||
g_critical ("g_settings_bind: property '%s' on class '%s' has type "
|
g_critical ("g_settings_bind: property '%s' on class '%s' has type "
|
||||||
"'%s' which is not compatible with type '%s' of key '%s' "
|
"'%s' which is not compatible with type '%s' of key '%s' "
|
||||||
"on schema '%s'", binding->property->name, G_OBJECT_TYPE_NAME (object),
|
"on schema '%s'", binding->property->name, G_OBJECT_TYPE_NAME (object),
|
||||||
g_type_name (binding->property->value_type),
|
g_type_name (binding->property->value_type),
|
||||||
g_variant_type_dup_string (binding->key.type), key,
|
type_string, key,
|
||||||
g_settings_schema_get_id (settings->priv->schema));
|
g_settings_schema_get_id (settings->priv->schema));
|
||||||
|
g_free (type_string);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4738,10 +4738,13 @@ g_variant_valist_new_nnp (const gchar **str,
|
|||||||
type = g_variant_type_element (type);
|
type = g_variant_type_element (type);
|
||||||
|
|
||||||
if G_UNLIKELY (!g_variant_type_is_subtype_of (type, (GVariantType *) *str))
|
if G_UNLIKELY (!g_variant_type_is_subtype_of (type, (GVariantType *) *str))
|
||||||
|
{
|
||||||
|
gchar *type_string = g_variant_type_dup_string ((GVariantType *) *str);
|
||||||
g_error ("g_variant_new: expected GVariantBuilder array element "
|
g_error ("g_variant_new: expected GVariantBuilder array element "
|
||||||
"type '%s' but the built value has element type '%s'",
|
"type '%s' but the built value has element type '%s'",
|
||||||
g_variant_type_dup_string ((GVariantType *) *str),
|
type_string, g_variant_get_type_string (value) + 1);
|
||||||
g_variant_get_type_string (value) + 1);
|
g_free (type_string);
|
||||||
|
}
|
||||||
|
|
||||||
g_variant_type_string_scan (*str, NULL, str);
|
g_variant_type_string_scan (*str, NULL, str);
|
||||||
|
|
||||||
@ -4803,10 +4806,13 @@ g_variant_valist_new_nnp (const gchar **str,
|
|||||||
|
|
||||||
case '@':
|
case '@':
|
||||||
if G_UNLIKELY (!g_variant_is_of_type (ptr, (GVariantType *) *str))
|
if G_UNLIKELY (!g_variant_is_of_type (ptr, (GVariantType *) *str))
|
||||||
|
{
|
||||||
|
gchar *type_string = g_variant_type_dup_string ((GVariantType *) *str);
|
||||||
g_error ("g_variant_new: expected GVariant of type '%s' but "
|
g_error ("g_variant_new: expected GVariant of type '%s' but "
|
||||||
"received value has type '%s'",
|
"received value has type '%s'",
|
||||||
g_variant_type_dup_string ((GVariantType *) *str),
|
type_string, g_variant_get_type_string (ptr));
|
||||||
g_variant_get_type_string (ptr));
|
g_free (type_string);
|
||||||
|
}
|
||||||
|
|
||||||
g_variant_type_string_scan (*str, NULL, str);
|
g_variant_type_string_scan (*str, NULL, str);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user