Commit 942fc7f7 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

gst: Add poisoning to more types

parent 69400c9f
......@@ -103,6 +103,7 @@ static void
_gst_buffer_list_free (GstBufferList * list)
{
guint i, len;
gsize slice_size;
GST_LOG ("free %p", list);
......@@ -117,7 +118,13 @@ _gst_buffer_list_free (GstBufferList * list)
if (GST_BUFFER_LIST_IS_USING_DYNAMIC_ARRAY (list))
g_free (list->buffers);
g_slice_free1 (list->slice_size, list);
slice_size = list->slice_size;
#ifdef USE_POISONING
memset (list, 0xff, slice_size);
#endif
g_slice_free1 (slice_size, list);
}
static void
......
......@@ -216,6 +216,11 @@ _gst_caps_free (GstCaps * caps)
#ifdef DEBUG_REFCOUNT
GST_CAT_TRACE (GST_CAT_CAPS, "freeing caps %p", caps);
#endif
#ifdef USE_POISONING
memset (caps, 0xff, sizeof (GstCapsImpl));
#endif
g_slice_free1 (sizeof (GstCapsImpl), caps);
}
......
......@@ -108,6 +108,10 @@ _gst_context_free (GstContext * context)
}
g_free (context->context_type);
#ifdef USE_POISONING
memset (context, 0xff, sizeof (GstContext));
#endif
g_slice_free1 (sizeof (GstContext), context);
}
......
......@@ -922,6 +922,11 @@ static void
gst_date_time_free (GstDateTime * datetime)
{
g_date_time_unref (datetime->datetime);
#ifdef USE_POISONING
memset (datetime, 0xff, sizeof (GstDateTime));
#endif
g_slice_free (GstDateTime, datetime);
}
......
......@@ -228,6 +228,9 @@ _gst_event_free (GstEvent * event)
gst_structure_set_parent_refcount (s, NULL);
gst_structure_free (s);
}
#ifdef USE_POISONING
memset (event, 0xff, sizeof (GstEventImpl));
#endif
g_slice_free1 (sizeof (GstEventImpl), event);
}
......
......@@ -95,6 +95,7 @@ _gst_memory_free (GstMemory * mem)
allocator = mem->allocator;
gst_allocator_free (allocator, mem);
gst_object_unref (allocator);
}
......
......@@ -217,6 +217,9 @@ _gst_message_free (GstMessage * message)
gst_structure_set_parent_refcount (structure, NULL);
gst_structure_free (structure);
}
#ifdef USE_POISONING
memset (message, 0xff, sizeof (GstMessageImpl));
#endif
g_slice_free1 (sizeof (GstMessageImpl), message);
}
......
......@@ -335,6 +335,10 @@ gst_promise_free (GstMiniObject * object)
g_cond_clear (GST_PROMISE_COND (promise));
GST_LOG ("%p finalized", promise);
#ifdef USE_POISONING
memset (promise, 0xff, sizeof (GstPromiseImpl));
#endif
g_free (promise);
}
......
......@@ -195,6 +195,9 @@ _gst_query_free (GstQuery * query)
gst_structure_set_parent_refcount (s, NULL);
gst_structure_free (s);
}
#ifdef USE_POISONING
memset (query, 0xff, sizeof (GstQueryImpl));
#endif
g_slice_free1 (sizeof (GstQueryImpl), query);
}
......
......@@ -101,6 +101,9 @@ _gst_sample_free (GstSample * sample)
GST_MINI_OBJECT_CAST (sample));
gst_buffer_list_unref (sample->buffer_list);
}
#ifdef USE_POISONING
memset (sample, 0xff, sizeof (GstSample));
#endif
g_slice_free1 (sizeof (GstSample), sample);
}
......
......@@ -719,6 +719,10 @@ __gst_tag_list_free (GstTagList * list)
gst_structure_free (GST_TAG_LIST_STRUCTURE (list));
#ifdef USE_POISONING
memset (list, 0xff, sizeof (GstTagListImpl));
#endif
g_slice_free1 (sizeof (GstTagListImpl), list);
}
......
......@@ -309,6 +309,10 @@ gst_toc_free (GstToc * toc)
if (toc->tags != NULL)
gst_tag_list_unref (toc->tags);
#ifdef USE_POISONING
memset (toc, 0xff, sizeof (GstToc));
#endif
g_slice_free (GstToc, toc);
}
......@@ -325,6 +329,10 @@ gst_toc_entry_free (GstTocEntry * entry)
if (entry->tags != NULL)
gst_tag_list_unref (entry->tags);
#ifdef USE_POISONING
memset (entry, 0xff, sizeof (GstTocEntry));
#endif
g_slice_free (GstTocEntry, entry);
}
......
......@@ -1014,6 +1014,10 @@ _gst_uri_free (GstUri * uri)
g_hash_table_unref (uri->query);
g_free (uri->fragment);
#ifdef USE_POISONING
memset (uri, 0xff, sizeof (*uri));
#endif
g_slice_free1 (sizeof (*uri), uri);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment