Commit 27ae4440 authored by Christian Kellner's avatar Christian Kellner
Browse files

glue: plug tiny memory leak by freeing custom_id

The memory for custom_id, to identify a custom conversion, is
dynamically allocated, but was not freed in bolt_wire_conv_unref.
Explicitly set it to NULL in the other constructor so we don't
attempt to free invalid memory.
parent 6f7b323f
......@@ -477,6 +477,8 @@ bolt_wire_conv_unref (BoltWireConv *conv)
g_variant_type_free (conv->wire_type);
g_param_spec_unref (conv->prop_spec);
g_clear_pointer (&conv->custom_id, g_free);
g_free (conv);
......@@ -549,6 +551,7 @@ bolt_wire_conv_for (const GVariantType *wire_type,
conv->ref_count = 1;
conv->wire_type = g_variant_type_copy (wire_type);
conv->prop_spec = g_param_spec_ref (prop_spec);
conv->custom_id = NULL;
as_str = g_variant_type_equal (wire_type, G_VARIANT_TYPE_STRING);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment