If a property is not found (for example last-sample when
gst_debug_bin_to_dot_file is used while the pipeline is
slightly broken (thus no last-sample) the unref of the item
gvalue which is not refed fails. Only unref if it was found.
found = gst_iterator_find_custom (it,
(GCompareFunc) find_property, &item, &helper);
gst_iterator_free (it);
- if (found)
+ if (found) {
result = g_value_dup_object (&item);
- g_value_unset (&item);
+ g_value_unset (&item);
+ }
} else {
if (element_has_property (obj, name, expected_type)) {
result = obj;