registrychunks: Initialize typefind/element factory registry chunks with zeroes

This makes valgrind stop complaining about reading unitializated memory,
which is not initialized because it's just compiler-added struct padding...
This commit is contained in:
Sebastian Dröge 2010-04-09 13:08:13 +02:00
parent 7ddbee758d
commit b5e875d201

View file

@ -231,7 +231,10 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
GstRegistryChunkElementFactory *ef; GstRegistryChunkElementFactory *ef;
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature); GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
ef = g_slice_new (GstRegistryChunkElementFactory); /* Initialize with zeroes because of struct padding and
* valgrind complaining about copying unitialized memory
*/
ef = g_slice_new0 (GstRegistryChunkElementFactory);
chk = chk =
gst_registry_chunks_make_data (ef, gst_registry_chunks_make_data (ef,
sizeof (GstRegistryChunkElementFactory)); sizeof (GstRegistryChunkElementFactory));
@ -291,7 +294,10 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (feature); GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (feature);
gchar *str; gchar *str;
tff = g_slice_new (GstRegistryChunkTypeFindFactory); /* Initialize with zeroes because of struct padding and
* valgrind complaining about copying unitialized memory
*/
tff = g_slice_new0 (GstRegistryChunkTypeFindFactory);
chk = chk =
gst_registry_chunks_make_data (tff, gst_registry_chunks_make_data (tff,
sizeof (GstRegistryChunkTypeFindFactory)); sizeof (GstRegistryChunkTypeFindFactory));