Commit b28455b1 authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

memleak fix

Original commit message from CVS:
memleak fix
parent 6f2ff2f8
......@@ -290,9 +290,11 @@ gst_unitconv_register_unit(const gchar *domain_name,
unit_name = g_strdup(g_param_spec_get_name(unit_spec));
/* check if this unit name already exists */
g_return_val_if_fail (
g_hash_table_lookup(_gst_units, unit_name) == NULL, FALSE);
if (g_hash_table_lookup (_gst_units, unit_name) != NULL)
{
g_free (unit_name);
return FALSE;
}
if (is_domain_default){
/* check if an default unit already exists for this domain */
g_return_val_if_fail (
......@@ -310,7 +312,7 @@ gst_unitconv_register_unit(const gchar *domain_name,
unit->convert_to_funcs = g_hash_table_new(NULL,NULL);
/* unit->convert_properties = g_hash_table_new(g_str_hash,g_str_equal); */
g_hash_table_insert(_gst_units, g_strdup(unit_name), unit);
g_hash_table_insert(_gst_units, unit_name, unit);
if (is_domain_default){
g_hash_table_insert(_gst_unit_domain_defaults, g_strdup(domain_name), unit);
......
Supports Markdown
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