mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
registry: use g_slice_free for slice memory
Avoid memory list corruption, but g_free'ing slice memory.
This commit is contained in:
parent
0089bcd3e2
commit
ecbe3d4f2e
1 changed files with 9 additions and 10 deletions
|
@ -231,6 +231,7 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
|
||||||
GstRegistryChunkPluginFeature *pf = NULL;
|
GstRegistryChunkPluginFeature *pf = NULL;
|
||||||
GstRegistryChunk *chk = NULL;
|
GstRegistryChunk *chk = NULL;
|
||||||
GList *walk;
|
GList *walk;
|
||||||
|
gsize pf_size = 0;
|
||||||
|
|
||||||
if (!type_name) {
|
if (!type_name) {
|
||||||
GST_ERROR ("NULL feature type_name, aborting.");
|
GST_ERROR ("NULL feature type_name, aborting.");
|
||||||
|
@ -245,9 +246,8 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
|
||||||
* valgrind complaining about copying unitialized memory
|
* valgrind complaining about copying unitialized memory
|
||||||
*/
|
*/
|
||||||
ef = g_slice_new0 (GstRegistryChunkElementFactory);
|
ef = g_slice_new0 (GstRegistryChunkElementFactory);
|
||||||
chk =
|
pf_size = sizeof (GstRegistryChunkElementFactory);
|
||||||
gst_registry_chunks_make_data (ef,
|
chk = gst_registry_chunks_make_data (ef, pf_size);
|
||||||
sizeof (GstRegistryChunkElementFactory));
|
|
||||||
ef->npadtemplates = ef->ninterfaces = ef->nuriprotocols = 0;
|
ef->npadtemplates = ef->ninterfaces = ef->nuriprotocols = 0;
|
||||||
pf = (GstRegistryChunkPluginFeature *) ef;
|
pf = (GstRegistryChunkPluginFeature *) ef;
|
||||||
|
|
||||||
|
@ -306,9 +306,8 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
|
||||||
* valgrind complaining about copying unitialized memory
|
* valgrind complaining about copying unitialized memory
|
||||||
*/
|
*/
|
||||||
tff = g_slice_new0 (GstRegistryChunkTypeFindFactory);
|
tff = g_slice_new0 (GstRegistryChunkTypeFindFactory);
|
||||||
chk =
|
pf_size = sizeof (GstRegistryChunkTypeFindFactory);
|
||||||
gst_registry_chunks_make_data (tff,
|
chk = gst_registry_chunks_make_data (tff, pf_size);
|
||||||
sizeof (GstRegistryChunkTypeFindFactory));
|
|
||||||
tff->nextensions = 0;
|
tff->nextensions = 0;
|
||||||
pf = (GstRegistryChunkPluginFeature *) tff;
|
pf = (GstRegistryChunkPluginFeature *) tff;
|
||||||
|
|
||||||
|
@ -349,8 +348,8 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
|
||||||
|
|
||||||
/* Errors */
|
/* Errors */
|
||||||
fail:
|
fail:
|
||||||
g_free (chk);
|
g_slice_free (GstRegistryChunk, chk);
|
||||||
g_free (pf);
|
g_slice_free1 (pf_size, pf);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,8 +464,8 @@ _priv_gst_registry_chunks_save_plugin (GList ** list, GstRegistry * registry,
|
||||||
/* Errors */
|
/* Errors */
|
||||||
fail:
|
fail:
|
||||||
gst_plugin_feature_list_free (plugin_features);
|
gst_plugin_feature_list_free (plugin_features);
|
||||||
g_free (chk);
|
g_slice_free (GstRegistryChunk, chk);
|
||||||
g_free (pe);
|
g_slice_free (GstRegistryChunkPluginElement, pe);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue