GNOME Bugzilla – Bug 110757
[0.6.2] memory corruption fix
Last modified: 2004-12-22 21:47:04 UTC
g_list_concat does _not_ copy the lists. Folk, please read the documentation before using any library functions.
Created attachment 15708 [details] [review] fix memory corruption in the registry
shoot me, stupid thing. This will be fixed when I commit my rewrite of registry/registrypool/plugin querying code.
CVS HEAD appears to be fixed. i'm not sure whether 0.6.1 needs a fix for this problem. Otherwise, close this bug.
There's no gstregistrypool.c in 0.6.x. There is a gstregistry.c with the following code: GList* gst_registry_pool_plugin_list (void) { GList *result = NULL; GList *walk = _gst_registry_pool; while (walk) { GstRegistry *registry = GST_REGISTRY (walk->data); /* FIXME only include highest priority plugins */ result = g_list_concat (result, g_list_copy (registry->plugins)); walk = g_list_next (walk); } return g_list_concat (_gst_registry_pool_plugins, result); } I'm assuming I need to use g_list_copy() on _gst_registry_pool_plugins here too?
Yes, you need g_list_concat if the GList is supposed to be freed by the caller (i don't have 0.6.x source code handy so i can't check). g_list_concat does _not_ copy the list.
Created attachment 16221 [details] [review] for review
fixed in 0.6 branch