diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2016-05-04 10:53:32 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-05-06 09:48:14 +0300 |
commit | 89fac4e81b6b472247ee21e9c9c144130b95d252 (patch) | |
tree | a5d4c618f341b2c13fbb187d60ac8b7d4e56e184 | |
parent | 372ccb7943453080d05a7df9c765f17bd143c921 (diff) |
utils: fix element leak in find_common_root()
The root element was not unreffed when iterating over ancestors.
https://bugzilla.gnome.org/show_bug.cgi?id=765961
-rw-r--r-- | gst/gstutils.c | 2 | ||||
-rw-r--r-- | tests/check/pipelines/parse-launch.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/gst/gstutils.c b/gst/gstutils.c index 69458c05c6..a26bde6932 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -1363,11 +1363,13 @@ find_common_root (GstObject * o1, GstObject * o2) gst_object_unref (kid2); return root; } + gst_object_unref (root); root = kid2; if (!object_has_ancestor (o2, kid1, &kid2)) { gst_object_unref (kid1); return root; } + gst_object_unref (root); root = kid1; } } diff --git a/tests/check/pipelines/parse-launch.c b/tests/check/pipelines/parse-launch.c index 78a2ba4f65..091c747612 100644 --- a/tests/check/pipelines/parse-launch.c +++ b/tests/check/pipelines/parse-launch.c @@ -52,6 +52,7 @@ setup_pipeline (const gchar * pipe_descr) fail_unless (pipeline != NULL, "Failed to create pipeline %s", pipe_descr); /* Newly returned object should be floating reffed */ fail_unless (g_object_is_floating (pipeline)); + g_assert_cmpuint (G_OBJECT (pipeline)->ref_count, ==, 1); return pipeline; } |