gstallocator: Use the right allocator instance to free memory

In the case GST_ALLOCATOR_FLAG_CUSTOM_ALLOC is set, `copy` is allocated
by the default allocator and not mem->allocator.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4144>
This commit is contained in:
Xavier Claessens 2023-03-09 22:18:12 -08:00 committed by GStreamer Marge Bot
parent f3665ce800
commit 174132af8d

View file

@ -110,7 +110,7 @@ _fallback_mem_copy (GstMemory * mem, gssize offset, gssize size)
if (!gst_memory_map (copy, &dinfo, GST_MAP_WRITE)) {
GST_CAT_WARNING (GST_CAT_MEMORY, "could not write map memory %p", copy);
gst_allocator_free (mem->allocator, copy);
gst_allocator_free (copy->allocator, copy);
gst_memory_unmap (mem, &sinfo);
return NULL;
}