Skip to content

gparam: fix memory leak in g_param_value_defaults()

We cannot just call

G_PARAM_SPEC_GET_CLASS (pspec)->value_set_default (pspec, &dflt_value);

without initializing the GValue first. It would call param_string_set_default(), which would set the pointer value to a cloned string (which later never gets released, because the GValue is not known to hold a string).

Fixes: 6ad799ac

CC: @ebassi

Merge request reports