Commit 0b97bcaa authored by Christian Kellner's avatar Christian Kellner
Browse files

glue: fix memory leak in conv_flags_to_str

The function 'bolt_flags_class_to_string' returns a dynamically
allocated string. This was previously not freed, creating a memory
leak. Its ownership is now correctly transferred to the GVariant
parent 27ae4440
Pipeline #236328 passed with stage
in 4 minutes and 28 seconds
...@@ -319,7 +319,7 @@ conv_flags_to_str (BoltWireConv *conv, ...@@ -319,7 +319,7 @@ conv_flags_to_str (BoltWireConv *conv,
GError **error) GError **error)
{ {
GParamSpecFlags *fs; GParamSpecFlags *fs;
const char *str; char *str;
guint uv; guint uv;
fs = G_PARAM_SPEC_FLAGS (conv->prop_spec); fs = G_PARAM_SPEC_FLAGS (conv->prop_spec);
...@@ -330,7 +330,7 @@ conv_flags_to_str (BoltWireConv *conv, ...@@ -330,7 +330,7 @@ conv_flags_to_str (BoltWireConv *conv,
if (str == NULL) if (str == NULL)
return NULL; return NULL;
return g_variant_new_string (str); return g_variant_new_take_string (str);
} }
static gboolean static gboolean
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