Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gstreamer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2022-11-08 18:44:54 +0300
committerTim-Philipp Müller <tim@centricular.com>2022-11-09 04:47:51 +0300
commitef8474aad514fab5b3f4a5b36d8626405af1dbc7 (patch)
treecb372d034215dfb74f9a35ef5b12bec8d8e0eb0f
parent3cc45d5a368e3471ee27c6a895d79b7b164415e8 (diff)
allocator: Copy allocator name in gst_allocator_register()
The parameter is not marked as `transfer full` and stays around in the hash table, so we will have to copy it ourselves. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3369>
-rw-r--r--subprojects/gstreamer/gst/gstallocator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/subprojects/gstreamer/gst/gstallocator.c b/subprojects/gstreamer/gst/gstallocator.c
index 6b3047636d..28f1db5da7 100644
--- a/subprojects/gstreamer/gst/gstallocator.c
+++ b/subprojects/gstreamer/gst/gstallocator.c
@@ -233,7 +233,8 @@ gst_allocator_register (const gchar * name, GstAllocator * allocator)
g_rw_lock_writer_lock (&lock);
/* The ref will never be released */
GST_OBJECT_FLAG_SET (allocator, GST_OBJECT_FLAG_MAY_BE_LEAKED);
- g_hash_table_insert (allocators, (gpointer) name, (gpointer) allocator);
+ g_hash_table_insert (allocators, (gpointer) g_strdup (name),
+ (gpointer) allocator);
g_rw_lock_writer_unlock (&lock);
}
@@ -599,7 +600,7 @@ void
_priv_gst_allocator_initialize (void)
{
g_rw_lock_init (&lock);
- allocators = g_hash_table_new_full (g_str_hash, g_str_equal, NULL,
+ allocators = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
gst_object_unref);
#ifdef HAVE_GETPAGESIZE