[Bug 765794] registrychunks: Memory leak

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon May 9 10:43:12 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=765794

Tim-Philipp Müller <t.i.m at zen.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #327205|none                        |needs-work
             status|                            |

--- Comment #10 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
Comment on attachment 327205
  --> https://bugzilla.gnome.org/attachment.cgi?id=327205
fix_memory_leak: Review comments incorporated.

Out of curiosity, is this something you ran into in practice or is this to fix
static code analyzer / coverity warnings?

I don't really understand the changes made to
gst_registry_chunks_load_feature() - here any partial string arrays should be
freed as part of the g_object_unref(feature) in the fail label (via the
factory's finalize function).


>@@ -731,6 +752,7 @@ static gchar **
> gst_registry_chunks_load_plugin_dep_strv (gchar ** in, gchar * end, guint n)
> {
>   gchar **arr;
>+  guint n_count = n;
> 
>   if (n == 0)
>     return NULL;
>@@ -742,6 +764,9 @@ gst_registry_chunks_load_plugin_dep_strv (gchar ** in, gchar * end, guint n)
>   }
>   return arr;
> fail:
>+  for (; n < n_count; ++n)
>+    g_free (arr[n]);
>+  g_free (arr);
>   GST_INFO ("Reading plugin dependency strings failed");
>   return NULL;
> }

I think here it'd be enough to simply do g_strfreev(arr).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list